-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: org.hibernate.transaction.JDBCTransactionFactory
PostPosted: Wed Jun 05, 2013 12:23 pm 
Newbie

Joined: Wed Jun 05, 2013 12:07 pm
Posts: 1
Good morning,

I'm using an app thats has org.hibernate.transaction.JDBCTransactionFactory to manage the transaction. In addition, this app do not use EJB for managed only use Hibernate and sessionFactory.
In each method has something like this :

try {
HibernateUtil.beginTransaction();
HibernateUtil.getCurrentSession().setFlushMode(FlushMode.MANUAL);
List<xx> list= XXxDAO.INSTANCE.getObjetctByData(id,name);
HibernateUtil.commitCurrentTransaction();
return list;
} finally {
HibernateUtil.closeCurrentSession();
}


In my opinion, if I use org.hibernate.transaction.JDBCTransactionFactory and I am not use JTA, then the Transactions aren't managed for JEE, then the session are open and close in each method and not for request, or another option.
In the other hand, I have a problem that in a SELECT has a commit, so, I am not sure is the correct way to use, I'will use a closetransaccion, the commit option. I will use only if I have a modify, delete or insert.

Which is your opinion?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.