You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by David Blevins <da...@visi.com> on 2010/07/06 23:43:48 UTC

Upgrading a 1.0 connector

Mostly directed at David Jencks.

So if I had to upgrade a 1.0 ra.xml to a 1.5 or 1.6 ra.xml, what is required?  Is it possible to simply "translate" the xml to the newer style or is there no real lineup?

-David


Re: Upgrading a 1.0 connector

Posted by David Blevins <da...@visi.com>.
On Jul 6, 2010, at 4:59 PM, David Jencks wrote:

> 
> On Jul 6, 2010, at 4:33 PM, David Blevins wrote:
> 
>> 
>> On Jul 6, 2010, at 3:56 PM, David Jencks wrote:
>> 
>>> 
>>> On Jul 6, 2010, at 3:40 PM, David Blevins wrote:
>>> 
>>>> 
>>>> On Jul 6, 2010, at 3:05 PM, David Jencks wrote:
>>>> 
>>>>> Openejb trunk now reads both 1.0 and 1/5/1.6  ra.xml's so I'm not sure why you would need to upgrade.
>>>>> 
>>>>> However, if you do..... you can upgrade the xml easily, it's basically putting a couple elements in between IIRC connector and outbound-connectionfactory.
>>>>> 
>>>>> Let me know if you have any difficulties.  BTW, what 1.0 ra.xml did you find?
>>>> 
>>>> Don't have one, just trying to understand the 1.0/1.6 classes.  It looks like it is doing the dynamic translation via subclassing.
>>>> 
>>>> Do we need the ResourceAdapter16 subclass?  Is there some sort of JAXB limitation that requires us to override that one method?
>>> 
>>> I couldn't find a way to make it work without the subclasses, but I don't recall the exact problem when I tried without them.  I do want the jaxb classes to be 2-way with the xml, and IIRC some of the solutions I tried only went from xml to java and not the other way -- generating 2 copies of some data in both the 1.0 and 1.6 appropriate elements. However, that was a few months ago and I may not be remembering too clearly.
>> 
>> I wonder how much code duplication we'd have if we just had a completely separate connector 1.0 set of objects and just translated them to the current model via some method rather than extensive subclassing.  Could even do something like make a constructor in the new model that took the old connector model and pulled all the data out.  Something like:
>> 
>>  new Connector(connector10);
>> 
>> And that constructor would do all the translating.
>> 
>> Just sort of brainstorming.
>> 
> 
> I don't really think this much subclassing is "extensive", but I'm pretty sure your suggestion would work fine for xml>> java.  Once you convert from 1.0 to 1.6 java objects, there's no good way to get back to 1.0 xml.  However, since 1.0 xml is never affected by annotations, we wouldn't be modifying it and needing to go backwards, so I'm not sure this would be a big problem. I don't think I'd have any big problems rewriting 1.0 to 1.6 xml anyway.
> 
> Want me to try this out?

Sure, give it a whirl. :)

-David

>> 
>>>>> On Jul 6, 2010, at 2:43 PM, David Blevins wrote:
>>>>> 
>>>>>> Mostly directed at David Jencks.
>>>>>> 
>>>>>> So if I had to upgrade a 1.0 ra.xml to a 1.5 or 1.6 ra.xml, what is required?  Is it possible to simply "translate" the xml to the newer style or is there no real lineup?
>>>>>> 
>>>>>> -David
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>> 
>>> 
>> 
> 
> 


Re: Upgrading a 1.0 connector

Posted by David Jencks <da...@yahoo.com>.
On Jul 6, 2010, at 4:33 PM, David Blevins wrote:

> 
> On Jul 6, 2010, at 3:56 PM, David Jencks wrote:
> 
>> 
>> On Jul 6, 2010, at 3:40 PM, David Blevins wrote:
>> 
>>> 
>>> On Jul 6, 2010, at 3:05 PM, David Jencks wrote:
>>> 
>>>> Openejb trunk now reads both 1.0 and 1/5/1.6  ra.xml's so I'm not sure why you would need to upgrade.
>>>> 
>>>> However, if you do..... you can upgrade the xml easily, it's basically putting a couple elements in between IIRC connector and outbound-connectionfactory.
>>>> 
>>>> Let me know if you have any difficulties.  BTW, what 1.0 ra.xml did you find?
>>> 
>>> Don't have one, just trying to understand the 1.0/1.6 classes.  It looks like it is doing the dynamic translation via subclassing.
>>> 
>>> Do we need the ResourceAdapter16 subclass?  Is there some sort of JAXB limitation that requires us to override that one method?
>> 
>> I couldn't find a way to make it work without the subclasses, but I don't recall the exact problem when I tried without them.  I do want the jaxb classes to be 2-way with the xml, and IIRC some of the solutions I tried only went from xml to java and not the other way -- generating 2 copies of some data in both the 1.0 and 1.6 appropriate elements. However, that was a few months ago and I may not be remembering too clearly.
> 
> I wonder how much code duplication we'd have if we just had a completely separate connector 1.0 set of objects and just translated them to the current model via some method rather than extensive subclassing.  Could even do something like make a constructor in the new model that took the old connector model and pulled all the data out.  Something like:
> 
>   new Connector(connector10);
> 
> And that constructor would do all the translating.
> 
> Just sort of brainstorming.
> 

I don't really think this much subclassing is "extensive", but I'm pretty sure your suggestion would work fine for xml>> java.  Once you convert from 1.0 to 1.6 java objects, there's no good way to get back to 1.0 xml.  However, since 1.0 xml is never affected by annotations, we wouldn't be modifying it and needing to go backwards, so I'm not sure this would be a big problem. I don't think I'd have any big problems rewriting 1.0 to 1.6 xml anyway.

Want me to try this out?

thanks
david jencks

> 
> -David
> 
> 
>>>> On Jul 6, 2010, at 2:43 PM, David Blevins wrote:
>>>> 
>>>>> Mostly directed at David Jencks.
>>>>> 
>>>>> So if I had to upgrade a 1.0 ra.xml to a 1.5 or 1.6 ra.xml, what is required?  Is it possible to simply "translate" the xml to the newer style or is there no real lineup?
>>>>> 
>>>>> -David
>>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
> 


Re: Upgrading a 1.0 connector

Posted by David Blevins <da...@visi.com>.
On Jul 6, 2010, at 3:56 PM, David Jencks wrote:

> 
> On Jul 6, 2010, at 3:40 PM, David Blevins wrote:
> 
>> 
>> On Jul 6, 2010, at 3:05 PM, David Jencks wrote:
>> 
>>> Openejb trunk now reads both 1.0 and 1/5/1.6  ra.xml's so I'm not sure why you would need to upgrade.
>>> 
>>> However, if you do..... you can upgrade the xml easily, it's basically putting a couple elements in between IIRC connector and outbound-connectionfactory.
>>> 
>>> Let me know if you have any difficulties.  BTW, what 1.0 ra.xml did you find?
>> 
>> Don't have one, just trying to understand the 1.0/1.6 classes.  It looks like it is doing the dynamic translation via subclassing.
>> 
>> Do we need the ResourceAdapter16 subclass?  Is there some sort of JAXB limitation that requires us to override that one method?
> 
> I couldn't find a way to make it work without the subclasses, but I don't recall the exact problem when I tried without them.  I do want the jaxb classes to be 2-way with the xml, and IIRC some of the solutions I tried only went from xml to java and not the other way -- generating 2 copies of some data in both the 1.0 and 1.6 appropriate elements. However, that was a few months ago and I may not be remembering too clearly.

I wonder how much code duplication we'd have if we just had a completely separate connector 1.0 set of objects and just translated them to the current model via some method rather than extensive subclassing.  Could even do something like make a constructor in the new model that took the old connector model and pulled all the data out.  Something like:

   new Connector(connector10);

And that constructor would do all the translating.

Just sort of brainstorming.


-David


>>> On Jul 6, 2010, at 2:43 PM, David Blevins wrote:
>>> 
>>>> Mostly directed at David Jencks.
>>>> 
>>>> So if I had to upgrade a 1.0 ra.xml to a 1.5 or 1.6 ra.xml, what is required?  Is it possible to simply "translate" the xml to the newer style or is there no real lineup?
>>>> 
>>>> -David
>>>> 
>>> 
>>> 
>> 
> 
> 


Re: Upgrading a 1.0 connector

Posted by David Jencks <da...@yahoo.com>.
On Jul 6, 2010, at 3:40 PM, David Blevins wrote:

> 
> On Jul 6, 2010, at 3:05 PM, David Jencks wrote:
> 
>> Openejb trunk now reads both 1.0 and 1/5/1.6  ra.xml's so I'm not sure why you would need to upgrade.
>> 
>> However, if you do..... you can upgrade the xml easily, it's basically putting a couple elements in between IIRC connector and outbound-connectionfactory.
>> 
>> Let me know if you have any difficulties.  BTW, what 1.0 ra.xml did you find?
> 
> Don't have one, just trying to understand the 1.0/1.6 classes.  It looks like it is doing the dynamic translation via subclassing.
> 
> Do we need the ResourceAdapter16 subclass?  Is there some sort of JAXB limitation that requires us to override that one method?

I couldn't find a way to make it work without the subclasses, but I don't recall the exact problem when I tried without them.  I do want the jaxb classes to be 2-way with the xml, and IIRC some of the solutions I tried only went from xml to java and not the other way -- generating 2 copies of some data in both the 1.0 and 1.6 appropriate elements. However, that was a few months ago and I may not be remembering too clearly.

thanks
david jencks

> 
> 
> -David
> 
> 
>> On Jul 6, 2010, at 2:43 PM, David Blevins wrote:
>> 
>>> Mostly directed at David Jencks.
>>> 
>>> So if I had to upgrade a 1.0 ra.xml to a 1.5 or 1.6 ra.xml, what is required?  Is it possible to simply "translate" the xml to the newer style or is there no real lineup?
>>> 
>>> -David
>>> 
>> 
>> 
> 


Re: Upgrading a 1.0 connector

Posted by David Blevins <da...@visi.com>.
On Jul 6, 2010, at 3:05 PM, David Jencks wrote:

> Openejb trunk now reads both 1.0 and 1/5/1.6  ra.xml's so I'm not sure why you would need to upgrade.
> 
> However, if you do..... you can upgrade the xml easily, it's basically putting a couple elements in between IIRC connector and outbound-connectionfactory.
> 
> Let me know if you have any difficulties.  BTW, what 1.0 ra.xml did you find?

Don't have one, just trying to understand the 1.0/1.6 classes.  It looks like it is doing the dynamic translation via subclassing.

Do we need the ResourceAdapter16 subclass?  Is there some sort of JAXB limitation that requires us to override that one method?


-David


> On Jul 6, 2010, at 2:43 PM, David Blevins wrote:
> 
>> Mostly directed at David Jencks.
>> 
>> So if I had to upgrade a 1.0 ra.xml to a 1.5 or 1.6 ra.xml, what is required?  Is it possible to simply "translate" the xml to the newer style or is there no real lineup?
>> 
>> -David
>> 
> 
> 


Re: Upgrading a 1.0 connector

Posted by David Jencks <da...@yahoo.com>.
Openejb trunk now reads both 1.0 and 1/5/1.6  ra.xml's so I'm not sure why you would need to upgrade.

However, if you do..... you can upgrade the xml easily, it's basically putting a couple elements in between IIRC connector and outbound-connectionfactory.

Let me know if you have any difficulties.  BTW, what 1.0 ra.xml did you find?

thanks
david jencks


On Jul 6, 2010, at 2:43 PM, David Blevins wrote:

> Mostly directed at David Jencks.
> 
> So if I had to upgrade a 1.0 ra.xml to a 1.5 or 1.6 ra.xml, what is required?  Is it possible to simply "translate" the xml to the newer style or is there no real lineup?
> 
> -David
>