*
The moose likes Object Relational Mapping and the fly likes How can we manage transactions using POJO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How can we manage transactions using POJO" Watch "How can we manage transactions using POJO" New topic
Author

How can we manage transactions using POJO

Harpreet Hira
Ranch Hand

Joined: Sep 27, 2001
Posts: 72
One of the features of EJBs that I admired the most was declarative transaction management. How are POJOs going to handle that?
Is the user manually going to use JTA or are we going to have some container who manages.
I guess I am still living in EJB world and the am out-of-sync with external world, which has gone past EJB.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3700
    
    5

Transaction management is more a function of session beans than entity beans, so even in a non-pojo EJBs can still support ORM with transactions. If you use container management transactions, you never have specify any transaction details other than in the XML deployment descriptor.

Further, most ORM implementations create a Connection Manager that, in the backend, manages persistent state of the objects and seamlessly connect with a database managers transaction manager such that the same level of control- functions like read commited, repeatable read, read uncommited, rollback, etc etc is fully supported. Keep in mind that ultimately POJO ORM get converted to JDBC that interact with database transactions the same way you would directly in JDBC.
[ January 27, 2006: Message edited by: Scott Selikoff ]

My Blog: Down Home Country Coding with Scott Selikoff
Chris Richardson
author
Ranch Hand

Joined: Jan 10, 2006
Posts: 50
Originally posted by Harpreet Hira:
One of the features of EJBs that I admired the most was declarative transaction management. How are POJOs going to handle that?
Is the user manually going to use JTA or are we going to have some container who manages.
I guess I am still living in EJB world and the am out-of-sync with external world, which has gone past EJB.


The Spring framework provides declarative transaction management for POJOs.

Chris


Enterprise Java consulting and training - <a href="http://www.chrisrichardson.net" target="_blank" rel="nofollow">http://www.chrisrichardson.net</a> Author, POJOs in Action - <a href="http://www.manning.com/crichardson" target="_blank" rel="nofollow">http://www.manning.com/crichardson</a> Enterprise POJOs blog - <a href="http://chris-richardson.blog-city.com" target="_blank" rel="nofollow">http://chris-richardson.blog-city.com</a>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How can we manage transactions using POJO
 
Similar Threads
how i develop simple ejb
EJB's are easy to build....are they?
New to JEE and java 1.6.
ejb deployment related
How should we prepare for the world cup?