You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Matthias Roth <ma...@impart.ch> on 2005/04/01 20:45:35 UTC

AW: Problems with PersistenceBrokerSyncImpl

Hi Armin
Should it not be hidden from the user of ojb. With this solution
A user of ojb has to implement two different db layers: one for managed 
Environment and one for not managed environment.  

What happens if I inherit from your PersistenceBrokerFactorySyncImpl class
And overwrite the begin, abort and commit Transaction function and implement
This functions as empty function?

Regards
Matthias

-----Ursprüngliche Nachricht-----
Von: Armin Waibel [mailto:arminw@apache.org] 
Gesendet: Dienstag, 29. März 2005 20:42
An: OJB Users List
Betreff: Re: Problems with PersistenceBrokerSyncImpl

Hi Matthias,

Matthias.Roth@BIT.admin.ch wrote:
> Hello
> We use OJB in a websphere z/OS environment. If I set the 
> PersistenceBrokerFactoryClass to PersistenceBrokerSyncImpl as it is 
> recommended in the documentation I get following error if I try to 
> insert, update or delete some thing:
> 
> Exception data: java.lang.UnsupportedOperationException: 
> In managed environments only JTA transaction demarcation allowed  at 
> org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl$Persistenc
> eBroke
> rSyncImpl.beginTransaction()
> 

In managed environments the tx handling/demarcation is done by JTA, so it's
no longer allowed to use the PB-tx demarcation.


> If I use the PersistenceBrokerFactoryDefaultImpl every thing works 'fine'
> (only the broker get out of
> synch with the container one time per day).
> 

If you use websphere as simple servlet engine without distributed tx, 
there is no need to use the JTA integration supported by PBFSyncImpl. If 
you use JTA it's mandatory to use PBFSyncImpl and JTA-tx demarcation.

regards,
Armin


> Can some one Help?
> 
> Matthias Roth
> 
> Bundesamt für Informatik und Telekommunikation BIT 
> Office fédéral de l'informatique et de la télécommunication OFIT
> 
> Ufficio federale dell'informatica e della telecomunicazione UFIT   
> Monbijoustrasse 74, CH-3003 Bern
> 
> Tel.        ++41 (0)31 325 84  68 
> Mobile    ++41 (0)79 307 45 29
> Fax        ++41 (0)31 325 97 54
> matthias.roth@bit.admin.ch
> matthias.roth@impart.ch
> http://www.bit.admin.ch/
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


AW: AW: Problems with PersistenceBrokerSyncImpl

Posted by Matthias Roth <ma...@impart.ch>.
Thanks for your Help I will try it and give you a feedback

Regards
Matthias 

-----Ursprüngliche Nachricht-----
Von: Armin Waibel [mailto:arminw@apache.org] 
Gesendet: Samstag, 2. April 2005 02:07
An: OJB Users List
Betreff: Re: AW: Problems with PersistenceBrokerSyncImpl

more elegant is to:

- extend PersistenceBrokerFactorySyncImpl
- extend inner class PersistenceBrokerSyncImpl and override beginTx, ... 
methods to noop
- override PersistenceBrokerFactorySyncImpl.wrapBrokerWithPoolingHandle
and return the extended PersistenceBrokerSyncImpl class

regards,
Armin

Armin Waibel wrote:
> Armin Waibel wrote:
> 
>> Matthias Roth wrote:
>>
>>> Hi Armin
>>> Should it not be hidden from the user of ojb. With this solution A 
>>> user of ojb has to implement two different db layers: one for 
>>> managed Environment and one for not managed environment. What 
>>> happens if I inherit from your PersistenceBrokerFactorySyncImpl 
>>> class And overwrite the begin, abort and commit Transaction function 
>>> and implement This functions as empty function?
>>>
>>
>> This could solve your problem, but this class is really complex. You 
>> have to extend inner class PBSyncHandle an override the methods.
>>
> 
> sorry, forget to note:
> 
> and override methods which instantiate PBSyncHandle
> 
> Armin
> 
> 
>> I will have a look at it, maybe I can integrate such a solution in 
>> the upcoming bug-fix release.
>>
>> regards,
>> Armin
>>
>>> Regards
>>> Matthias
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Armin Waibel [mailto:arminw@apache.org] Gesendet: Dienstag, 29. 
>>> März 2005 20:42
>>> An: OJB Users List
>>> Betreff: Re: Problems with PersistenceBrokerSyncImpl
>>>
>>> Hi Matthias,
>>>
>>> Matthias.Roth@BIT.admin.ch wrote:
>>>
>>>> Hello
>>>> We use OJB in a websphere z/OS environment. If I set the 
>>>> PersistenceBrokerFactoryClass to PersistenceBrokerSyncImpl as it is 
>>>> recommended in the documentation I get following error if I try to 
>>>> insert, update or delete some thing:
>>>>
>>>> Exception data: java.lang.UnsupportedOperationException: In managed 
>>>> environments only JTA transaction demarcation allowed  at 
>>>> org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl$Persist
>>>> enc
>>>> eBroke
>>>> rSyncImpl.beginTransaction()
>>>>
>>>
>>>
>>> In managed environments the tx handling/demarcation is done by JTA, 
>>> so it's no longer allowed to use the PB-tx demarcation.
>>>
>>>
>>>
>>>> If I use the PersistenceBrokerFactoryDefaultImpl every thing works 
>>>> 'fine'
>>>> (only the broker get out of
>>>> synch with the container one time per day).
>>>>
>>>
>>>
>>> If you use websphere as simple servlet engine without distributed tx, 
>>> there is no need to use the JTA integration supported by PBFSyncImpl. 
>>> If you use JTA it's mandatory to use PBFSyncImpl and JTA-tx demarcation.
>>>
>>> regards,
>>> Armin
>>>
>>>
>>>
>>>> Can some one Help?
>>>>
>>>> Matthias Roth
>>>>
>>>> Bundesamt für Informatik und Telekommunikation BIT Office fédéral de 
>>>> l'informatique et de la télécommunication OFIT
>>>>
>>>> Ufficio federale dell'informatica e della telecomunicazione UFIT   
>>>> Monbijoustrasse 74, CH-3003 Bern
>>>>
>>>> Tel.        ++41 (0)31 325 84  68 Mobile    ++41 (0)79 307 45 29
>>>> Fax        ++41 (0)31 325 97 54
>>>> matthias.roth@bit.admin.ch
>>>> matthias.roth@impart.ch
>>>> http://www.bit.admin.ch/
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: AW: Problems with PersistenceBrokerSyncImpl

Posted by Armin Waibel <ar...@apache.org>.
more elegant is to:

- extend PersistenceBrokerFactorySyncImpl
- extend inner class PersistenceBrokerSyncImpl and override beginTx, ... 
methods to noop
- override PersistenceBrokerFactorySyncImpl.wrapBrokerWithPoolingHandle 
and return the extended PersistenceBrokerSyncImpl class

regards,
Armin

Armin Waibel wrote:
> Armin Waibel wrote:
> 
>> Matthias Roth wrote:
>>
>>> Hi Armin
>>> Should it not be hidden from the user of ojb. With this solution
>>> A user of ojb has to implement two different db layers: one for 
>>> managed Environment and one for not managed environment. What happens 
>>> if I inherit from your PersistenceBrokerFactorySyncImpl class
>>> And overwrite the begin, abort and commit Transaction function and 
>>> implement
>>> This functions as empty function?
>>>
>>
>> This could solve your problem, but this class is really complex. You 
>> have to extend inner class PBSyncHandle an override the methods.
>>
> 
> sorry, forget to note:
> 
> and override methods which instantiate PBSyncHandle
> 
> Armin
> 
> 
>> I will have a look at it, maybe I can integrate such a solution in the 
>> upcoming bug-fix release.
>>
>> regards,
>> Armin
>>
>>> Regards
>>> Matthias
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Armin Waibel [mailto:arminw@apache.org] Gesendet: Dienstag, 29. 
>>> März 2005 20:42
>>> An: OJB Users List
>>> Betreff: Re: Problems with PersistenceBrokerSyncImpl
>>>
>>> Hi Matthias,
>>>
>>> Matthias.Roth@BIT.admin.ch wrote:
>>>
>>>> Hello
>>>> We use OJB in a websphere z/OS environment. If I set the 
>>>> PersistenceBrokerFactoryClass to PersistenceBrokerSyncImpl as it is 
>>>> recommended in the documentation I get following error if I try to 
>>>> insert, update or delete some thing:
>>>>
>>>> Exception data: java.lang.UnsupportedOperationException: In managed 
>>>> environments only JTA transaction demarcation allowed  at 
>>>> org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl$Persistenc
>>>> eBroke
>>>> rSyncImpl.beginTransaction()
>>>>
>>>
>>>
>>> In managed environments the tx handling/demarcation is done by JTA, 
>>> so it's
>>> no longer allowed to use the PB-tx demarcation.
>>>
>>>
>>>
>>>> If I use the PersistenceBrokerFactoryDefaultImpl every thing works 
>>>> 'fine'
>>>> (only the broker get out of
>>>> synch with the container one time per day).
>>>>
>>>
>>>
>>> If you use websphere as simple servlet engine without distributed tx, 
>>> there is no need to use the JTA integration supported by PBFSyncImpl. 
>>> If you use JTA it's mandatory to use PBFSyncImpl and JTA-tx demarcation.
>>>
>>> regards,
>>> Armin
>>>
>>>
>>>
>>>> Can some one Help?
>>>>
>>>> Matthias Roth
>>>>
>>>> Bundesamt für Informatik und Telekommunikation BIT Office fédéral de 
>>>> l'informatique et de la télécommunication OFIT
>>>>
>>>> Ufficio federale dell'informatica e della telecomunicazione UFIT   
>>>> Monbijoustrasse 74, CH-3003 Bern
>>>>
>>>> Tel.        ++41 (0)31 325 84  68 Mobile    ++41 (0)79 307 45 29
>>>> Fax        ++41 (0)31 325 97 54
>>>> matthias.roth@bit.admin.ch
>>>> matthias.roth@impart.ch
>>>> http://www.bit.admin.ch/
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: AW: Problems with PersistenceBrokerSyncImpl

Posted by Armin Waibel <ar...@apache.org>.
Armin Waibel wrote:
> Matthias Roth wrote:
> 
>> Hi Armin
>> Should it not be hidden from the user of ojb. With this solution
>> A user of ojb has to implement two different db layers: one for 
>> managed Environment and one for not managed environment. 
>> What happens if I inherit from your PersistenceBrokerFactorySyncImpl 
>> class
>> And overwrite the begin, abort and commit Transaction function and 
>> implement
>> This functions as empty function?
>>
> 
> This could solve your problem, but this class is really complex. You 
> have to extend inner class PBSyncHandle an override the methods.
>

sorry, forget to note:

and override methods which instantiate PBSyncHandle

Armin


> I will have a look at it, maybe I can integrate such a solution in the 
> upcoming bug-fix release.
> 
> regards,
> Armin
> 
>> Regards
>> Matthias
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Armin Waibel [mailto:arminw@apache.org] Gesendet: Dienstag, 29. 
>> März 2005 20:42
>> An: OJB Users List
>> Betreff: Re: Problems with PersistenceBrokerSyncImpl
>>
>> Hi Matthias,
>>
>> Matthias.Roth@BIT.admin.ch wrote:
>>
>>> Hello
>>> We use OJB in a websphere z/OS environment. If I set the 
>>> PersistenceBrokerFactoryClass to PersistenceBrokerSyncImpl as it is 
>>> recommended in the documentation I get following error if I try to 
>>> insert, update or delete some thing:
>>>
>>> Exception data: java.lang.UnsupportedOperationException: In managed 
>>> environments only JTA transaction demarcation allowed  at 
>>> org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl$Persistenc
>>> eBroke
>>> rSyncImpl.beginTransaction()
>>>
>>
>>
>> In managed environments the tx handling/demarcation is done by JTA, so 
>> it's
>> no longer allowed to use the PB-tx demarcation.
>>
>>
>>
>>> If I use the PersistenceBrokerFactoryDefaultImpl every thing works 
>>> 'fine'
>>> (only the broker get out of
>>> synch with the container one time per day).
>>>
>>
>>
>> If you use websphere as simple servlet engine without distributed tx, 
>> there is no need to use the JTA integration supported by PBFSyncImpl. 
>> If you use JTA it's mandatory to use PBFSyncImpl and JTA-tx demarcation.
>>
>> regards,
>> Armin
>>
>>
>>
>>> Can some one Help?
>>>
>>> Matthias Roth
>>>
>>> Bundesamt für Informatik und Telekommunikation BIT Office fédéral de 
>>> l'informatique et de la télécommunication OFIT
>>>
>>> Ufficio federale dell'informatica e della telecomunicazione UFIT   
>>> Monbijoustrasse 74, CH-3003 Bern
>>>
>>> Tel.        ++41 (0)31 325 84  68 Mobile    ++41 (0)79 307 45 29
>>> Fax        ++41 (0)31 325 97 54
>>> matthias.roth@bit.admin.ch
>>> matthias.roth@impart.ch
>>> http://www.bit.admin.ch/
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: AW: Problems with PersistenceBrokerSyncImpl

Posted by Armin Waibel <ar...@apache.org>.
Matthias Roth wrote:
> Hi Armin
> Should it not be hidden from the user of ojb. With this solution
> A user of ojb has to implement two different db layers: one for managed 
> Environment and one for not managed environment.  
> 
> What happens if I inherit from your PersistenceBrokerFactorySyncImpl class
> And overwrite the begin, abort and commit Transaction function and implement
> This functions as empty function?
>

This could solve your problem, but this class is really complex. You 
have to extend inner class PBSyncHandle an override the methods.

I will have a look at it, maybe I can integrate such a solution in the 
upcoming bug-fix release.

regards,
Armin

> Regards
> Matthias
> 
> -----Ursprüngliche Nachricht-----
> Von: Armin Waibel [mailto:arminw@apache.org] 
> Gesendet: Dienstag, 29. März 2005 20:42
> An: OJB Users List
> Betreff: Re: Problems with PersistenceBrokerSyncImpl
> 
> Hi Matthias,
> 
> Matthias.Roth@BIT.admin.ch wrote:
> 
>>Hello
>>We use OJB in a websphere z/OS environment. If I set the 
>>PersistenceBrokerFactoryClass to PersistenceBrokerSyncImpl as it is 
>>recommended in the documentation I get following error if I try to 
>>insert, update or delete some thing:
>>
>>Exception data: java.lang.UnsupportedOperationException: 
>>In managed environments only JTA transaction demarcation allowed  at 
>>org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl$Persistenc
>>eBroke
>>rSyncImpl.beginTransaction()
>>
> 
> 
> In managed environments the tx handling/demarcation is done by JTA, so it's
> no longer allowed to use the PB-tx demarcation.
> 
> 
> 
>>If I use the PersistenceBrokerFactoryDefaultImpl every thing works 'fine'
>>(only the broker get out of
>>synch with the container one time per day).
>>
> 
> 
> If you use websphere as simple servlet engine without distributed tx, 
> there is no need to use the JTA integration supported by PBFSyncImpl. If 
> you use JTA it's mandatory to use PBFSyncImpl and JTA-tx demarcation.
> 
> regards,
> Armin
> 
> 
> 
>>Can some one Help?
>>
>>Matthias Roth
>>
>>Bundesamt für Informatik und Telekommunikation BIT 
>>Office fédéral de l'informatique et de la télécommunication OFIT
>>
>>Ufficio federale dell'informatica e della telecomunicazione UFIT   
>>Monbijoustrasse 74, CH-3003 Bern
>>
>>Tel.        ++41 (0)31 325 84  68 
>>Mobile    ++41 (0)79 307 45 29
>>Fax        ++41 (0)31 325 97 54
>>matthias.roth@bit.admin.ch
>>matthias.roth@impart.ch
>>http://www.bit.admin.ch/
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org