You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Charlie Walker <ma...@gmail.com> on 2008/03/24 23:03:55 UTC

Migrating ejb 2.1 entity beans to jpa in weblogic

Hi,
I'm working on a project that involves migrating a set of ejb2.1 entity
beans to jpa.  The big snag we have run into is that the old code used a
weblogic specific descriptor
"<delay-updates-until-end-of-tx>false</delay-updates-until-end-of-tx>".  the
bea website documents this flag as such:
----------------------------------------------------------------------------------------------------
from "http://e-docs.bea.com/wls/docs100/ejb/entity.html#wp1195783 "
Updating the Database Before Transaction Ends

As described in Understanding ejbLoad() and ejbStore() Behavior, by default,
WebLogic Server calls ejbStore() only when the transaction commits.

To make intermediate results of uncommitted transactions available to other
database users, set delay-updates-until-end-of-tx in the persistence element
of weblogic-ejb-jar.xml to False—this causes WebLogic Server to call
ejbStore() after each method call.
Note:  While setting delay-updates-until-end-of-tx to false results in
database updates after each method call, the updates are not committed until
the end of the transaction.
----------------------------------------------------------------------------------------------------

While we would love to rewrite the code to eliminate the need for these
"dirty reads", we have been asked if we can just duplicate the weblogic
functionality.  weblogic uses openjpa 0.9.7 and we have an oracle 10g
database.  for yucks, we tried setting the openjpa transaction isolation
level to "read uncommitted" but it appears that oracle does not support
that.

Thanks for any help we can get,
Charlie.


-- 
Charlie Walker - Registered Linux User #62358

"Now and then we had a hope that if we lived and were good, God would permit
us to be pirates." - Mark Twain

Re: Migrating ejb 2.1 entity beans to jpa in weblogic

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Charlie,

If you're looking for the "write side" of the issue, try issuing an  
EntityManager.flush() to force writing changes to the open connection.  
Then, any connection with read uncommitted semantics will see the  
changes.

I don't know how to handle the "read side" if you cannot set read  
uncommitted on the connection properties.

Craig

On Mar 24, 2008, at 3:03 PM, Charlie Walker wrote:

> Hi,
> I'm working on a project that involves migrating a set of ejb2.1  
> entity
> beans to jpa.  The big snag we have run into is that the old code  
> used a
> weblogic specific descriptor
> "<delay-updates-until-end-of-tx>false</delay-updates-until-end-of- 
> tx>".  the
> bea website documents this flag as such:
> ----------------------------------------------------------------------------------------------------
> from "http://e-docs.bea.com/wls/docs100/ejb/entity.html#wp1195783 "
> Updating the Database Before Transaction Ends
>
> As described in Understanding ejbLoad() and ejbStore() Behavior, by  
> default,
> WebLogic Server calls ejbStore() only when the transaction commits.
>
> To make intermediate results of uncommitted transactions available  
> to other
> database users, set delay-updates-until-end-of-tx in the persistence  
> element
> of weblogic-ejb-jar.xml to False—this causes WebLogic Server to call
> ejbStore() after each method call.
> Note:  While setting delay-updates-until-end-of-tx to false results in
> database updates after each method call, the updates are not  
> committed until
> the end of the transaction.
> ----------------------------------------------------------------------------------------------------
>
> While we would love to rewrite the code to eliminate the need for  
> these
> "dirty reads", we have been asked if we can just duplicate the  
> weblogic
> functionality.  weblogic uses openjpa 0.9.7 and we have an oracle 10g
> database.  for yucks, we tried setting the openjpa transaction  
> isolation
> level to "read uncommitted" but it appears that oracle does not  
> support
> that.
>
> Thanks for any help we can get,
> Charlie.
>
>
> -- 
> Charlie Walker - Registered Linux User #62358
>
> "Now and then we had a hope that if we lived and were good, God  
> would permit
> us to be pirates." - Mark Twain

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!