wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Releasing Unit Of Work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Releasing Unit Of Work" Watch "Releasing Unit Of Work" New topic
Author

Releasing Unit Of Work

Dhiraj Wagh
Greenhorn

Joined: Feb 10, 2010
Posts: 3
I am using Toplink in my project. While releasing the Unit of Work, we check for the null value. If not null, then we release the unit of work.
But, we do have isActive attribute for UOW, So, shall we check for this attribute before releasing UOW.

Currently, using below one
if (uow != null)
uow.release();

Shall we use this.

if (uow.isActive())
uow.release();
Which approach is correct one...
James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
Either is probably ok, but first checking isActive() is more correct.


TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
Dhiraj Wagh
Greenhorn

Joined: Feb 10, 2010
Posts: 3
Thanks James..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Releasing Unit Of Work
 
Similar Threads
Toplink Cache removing on delete objects from database manually
How to get request scope attribute values thru HttpUnit
Toplink API
Problem with method
Creating threads in EJB