Question about DefaultConverter

4 views
Skip to first unread message

Andreas Pieber

unread,
Nov 20, 2013, 6:46:38 AM11/20/13
to OpenEngSB
This question is mainly to Felix and all other EDB specialists.

If you commit an object of your choice by type and value (e.g. "x" and java.nio.Path.class) and than load it again by using getObject you retrieve value: java.nio.Path and value: java.nio.Path. If you apply my attached Patch you retrieve value: "x" and type "java.nio.Path" which sounds like the better behavior IMHO.

Any ideas?

Kind regards,
Andreas

Andreas Pieber

unread,
Nov 20, 2013, 6:49:03 AM11/20/13
to OpenEngSB
Oh, and now the patch attached as promised :)

Kind regards,
Andreas
idea.patch

Felix Mayerhuber

unread,
Dec 3, 2013, 3:53:42 PM12/3/13
to openen...@googlegroups.com
Hi,

I've to correct you : ) it is not the case that always the type is
taken. The piece of software that you fix in your patch is correct, this
should be changed. But this piece is only invoked if in the method
before an exception was thrown. In all other cases, the correct value is
returned (see the try body). But you are right, in case of an error it
would be better to simply return the value instead of the type.

Kind regards,
Felix

Andreas Pieber

unread,
Dec 4, 2013, 2:28:52 AM12/4/13
to OpenEngSB
The problem is, that "error" is quite a general word here. I've encountered the problem only because someone tried to store an interface (java.nio.Path)...

Independently, if I've read your answer correctly, I'll simply apply the patch :-)

Kind regards,
Andreas



--
You received this message because you are subscribed to the Google Groups "OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openengsb-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Felix Mayerhuber

unread,
Dec 4, 2013, 5:14:26 AM12/4/13
to openen...@googlegroups.com
I don't wonder that you had the error with an interface, since
interfaces are not really supported by the EDB : ) The only interfaces
that are supported are List and Map. Because it is quite hard to make an
instance of an interface. So even if you apply this patch, I highly
doubt that interfaces are working. You will just get the String
representing this interfaces returned.

Kind regards,
Felix
>> email to openengsb-de...@googlegroups.com.

Andreas Pieber

unread,
Dec 4, 2013, 5:53:14 AM12/4/13
to OpenEngSB
Absolutely. But the result is somehow "more sane" than it is otherwise. The only other alternative is to throw an exception if someone tries to use it that way (instead of returning the value/type)

Kind regards,
Andreas



For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openengsb-dev+unsubscribe@googlegroups.com.

Felix Mayerhuber

unread,
Dec 4, 2013, 5:57:50 AM12/4/13
to openen...@googlegroups.com
You are absolutely right that it is more sane that way, it was a mistake
by me that I returned the type : ) just haven't noticed it. I am also
thinking that throwing an exception would be the most sane solution.
Question is: should we then abort the execution if such an exception is
thrown, or should just an error be logged and the field simply stays null?

Kind regards,
Felix
>>>> email to openengsb-de...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenEngSB developer discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to openengsb-de...@googlegroups.com.

Andreas Pieber

unread,
Dec 4, 2013, 6:07:36 AM12/4/13
to OpenEngSB
The "Problem" is rather that at this place it only happens during a query, doesn't it? Therefore simply logging the error we still have something to return; throwing an exception would abort the process. I personally have no real preferences, but typically the "fail-fast" approach is the better one... Do you give it a shot or should I?

Kind regards,
Andreas



For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openengsb-dev+unsubscribe@googlegroups.com.

Felix Mayerhuber

unread,
Dec 4, 2013, 6:23:45 AM12/4/13
to openen...@googlegroups.com
This error happens at loading time during the conversion of loaded
EDBObjects into models. I can check it, but just tell me if I should
abort the model loading in such a case, or return the model with
"incomplete" information.

Kind regards
Felix
>>>>>> email to openengsb-de...@googlegroups.com.
>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>
>>>>>>
>>>>>> --
>>>> You received this message because you are subscribed to the Google Groups
>>>> "OpenEngSB developer discussion" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an
>>>> email to openengsb-de...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenEngSB developer discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to openengsb-de...@googlegroups.com.

Andreas Pieber

unread,
Dec 4, 2013, 7:09:15 AM12/4/13
to OpenEngSB
OK, just talked with Stefan. We both think an exception saying that you have to write your custom translator would be the best...



For more options, visit https://groups.google.com/groups/opt_out.


  --
You received this message because you are subscribed to the Google Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openengsb-dev+unsubscribe@googlegroups.com.

Felix Mayerhuber

unread,
Dec 4, 2013, 9:50:57 AM12/4/13
to openen...@googlegroups.com
Ok, but I need to know if I should abort the model loading in such a
case or if I should return the model with "incomplete information"
(meaning every property where an error occured during the loading will
be filled with a null value)

Kind regards
Felix
>>>>>>>> email to openengsb-de...@googlegroups.com.
>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups
>>>>>> "OpenEngSB developer discussion" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>>> an
>>>>>> email to openengsb-de...@googlegroups.com.
>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>
>>>>>>
>>>>>> --
>>>> You received this message because you are subscribed to the Google Groups
>>>> "OpenEngSB developer discussion" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an
>>>> email to openengsb-de...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenEngSB developer discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to openengsb-de...@googlegroups.com.

Andreas Pieber

unread,
Dec 4, 2013, 10:12:53 AM12/4/13
to OpenEngSB
I would say cancel the entire loading. Where will the exception be caught?

Kind regards,
Andreas



For more options, visit https://groups.google.com/groups/opt_out.


   --

You received this message because you are subscribed to the Google
Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send
an

For more options, visit https://groups.google.com/groups/opt_out.


  --
You received this message because you are subscribed to the Google Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openengsb-dev+unsubscribe@googlegroups.com.

Felix Mayerhuber

unread,
Dec 4, 2013, 12:31:50 PM12/4/13
to openen...@googlegroups.com
Hm, I would say the exception will be forwarded to the QueryInterface. I
think there is the best place for that.

Kind regards
Felix
>>>>>>>>>> email to openengsb-de...@googlegroups.com.
>>>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>>
>>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups
>>>>>>>> "OpenEngSB developer discussion" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send
>>>>>>>> an
>>>>>>>> email to openengsb-de...@googlegroups.com.
>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups
>>>>>> "OpenEngSB developer discussion" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>>> an
>>>>>> email to openengsb-de...@googlegroups.com.
>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>
>>>>>>
>>>>>> --
>>>> You received this message because you are subscribed to the Google Groups
>>>> "OpenEngSB developer discussion" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an
>>>> email to openengsb-de...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenEngSB developer discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to openengsb-de...@googlegroups.com.

Andreas Pieber

unread,
Dec 4, 2013, 1:05:09 PM12/4/13
to OpenEngSB

+1


For more options, visit https://groups.google.com/groups/opt_out.


    --

  You received this message because you are subscribed to the Google
Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it,
send
an

For more options, visit https://groups.google.com/groups/opt_out.


   --

You received this message because you are subscribed to the Google
Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send
an

For more options, visit https://groups.google.com/groups/opt_out.


  --
You received this message because you are subscribed to the Google Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openengsb-dev+unsubscribe@googlegroups.com.

Felix Mayerhuber

unread,
Dec 5, 2013, 10:45:32 AM12/5/13
to openen...@googlegroups.com
Created issue for that and I am on it:
http://issues.openengsb.org/jira/browse/OPENENGSB-3676

Kind regards
Felix
>>>>>>>>>>>> email to openengsb-de...@googlegroups.com.
>>>>>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out
>>>>>>>>>>>> .
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>>
>>>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>>>> Google
>>>>>>>>>>>>
>>>>>>>>>>> Groups
>>>>>>>>>> "OpenEngSB developer discussion" group.
>>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>>>> send
>>>>>>>>>> an
>>>>>>>>>> email to openengsb-de...@googlegroups.com.
>>>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>>
>>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups
>>>>>>>> "OpenEngSB developer discussion" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send
>>>>>>>> an
>>>>>>>> email to openengsb-de...@googlegroups.com.
>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups
>>>>>> "OpenEngSB developer discussion" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>>> an
>>>>>> email to openengsb-de...@googlegroups.com.
>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>
>>>>>>
>>>>>> --
>>>> You received this message because you are subscribed to the Google Groups
>>>> "OpenEngSB developer discussion" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an
>>>> email to openengsb-de...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenEngSB developer discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to openengsb-de...@googlegroups.com.

Andreas Pieber

unread,
Dec 5, 2013, 10:46:27 AM12/5/13
to OpenEngSB
Thank you very much :-)



For more options, visit https://groups.google.com/groups/opt_out
.


     --

   You received this message because you are subscribed to the
Google

Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it,
send
an

For more options, visit https://groups.google.com/groups/opt_out.


    --

  You received this message because you are subscribed to the Google
Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it,
send
an

For more options, visit https://groups.google.com/groups/opt_out.


   --

You received this message because you are subscribed to the Google
Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send
an

For more options, visit https://groups.google.com/groups/opt_out.


  --
You received this message because you are subscribed to the Google Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups
"OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "OpenEngSB developer discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openengsb-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages