File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes session.connection() is depricated . How to setAutoCommit(false) ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "session.connection() is depricated . How to setAutoCommit(false) ?" Watch "session.connection() is depricated . How to setAutoCommit(false) ?" New topic
Author

session.connection() is depricated . How to setAutoCommit(false) ?

dileep keely
Ranch Hand

Joined: Jun 28, 2010
Posts: 91
Hi All,

I want to do a rollback if an exception occur. I have used the below for connecting and setting the autocommit as false.
But as you know that "session.connection" is depricated. How can I set the autocommit as false.



query:
1.Iam afraid if I set autocommit as false explicitly from the properties files the rest of the existing code (say some other 20+ DAOIMPL files ) I should do commit() if we set from properties as autocommit as false ?? Please clarify me is this is correct?
2.How to do autocommit as false without explicitly setting from properties file.

Any way still using the hibernateTemplate ?

Please suggest me.
dileep keely
Ranch Hand

Joined: Jun 28, 2010
Posts: 91
Got a way out by using spring Transaction management
 
Don't get me started about those stupid light bulbs.
 
subject: session.connection() is depricated . How to setAutoCommit(false) ?