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.  [ 2 posts ] 
Author Message
 Post subject: Auto start Transection in hibernate.....????
PostPosted: Wed Jan 14, 2009 1:02 am 
Beginner
Beginner

Joined: Sat May 31, 2008 2:35 am
Posts: 30
Location: pakistan
hello
is there any way Hibernate Transection automatically start i mean i want to only set its property in Hibernate.cfg.xml file..... i have to do Auto session close bt not find a way to auto start Transection

i set that property in Hibernate.cfg.xml file and my session close after every transection automatically

<property name="hibernate.transaction.auto_close_session">true</property>
<property name="hibernate.connection.release_mode">after_transaction</property>



now i want simply to start Transection automatically and i not start it mabually like
Transaction tx = session.beginTransaction();
....
......

tx.commit();

is there any property same in Hibernate.cfg.xml file
any idea abt it..........
waiting fr response
TC


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 14, 2009 3:32 am 
Beginner
Beginner

Joined: Wed Nov 19, 2008 8:25 am
Posts: 46
Location: Saint Petersburg, Russian Federation
There is no way to do that with the pure hibernate at the standalone j2se environment.

It's necessary to exploit existing transactions system that automatically manages transactions for you. For example EJB and spring provide such facility.


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

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.