aspose file tools*
The moose likes Spring and the fly likes Spring JDBC Transaction vs Connection ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring JDBC Transaction vs Connection ?" Watch "Spring JDBC Transaction vs Connection ?" New topic
Author

Spring JDBC Transaction vs Connection ?

Jayaraj Jaganathan
Ranch Hand

Joined: Jun 29, 2009
Posts: 70
someone please clear my doubt ..

please first look into my code








Now the connection created by spring is
14:15:12,531 DEBUG DataSourceTransactionManager:222 - Switching JDBC Connection [org.hsqldb.jdbc.jdbcConnection@456a456a] to manual commit


the connection which i get is
org.hsqldb.jdbc.jdbcConnection@6bd26bd2


i hope i have did mistake, but i don't know where i did it. please help me

Jayaraj Jaganathan
Ranch Hand

Joined: Jun 29, 2009
Posts: 70
i found the solution.

i am right both are different connection.

NOTE: if we need spring transaction then we have to use spring dao.i mean we can't use spring transaction API alone
Jayaraj Jaganathan
Ranch Hand

Joined: Jun 29, 2009
Posts: 70
to get the connection which is enabled by spring

DataSourceUtils.getConnection(getDataSource());
Jayaraj Jaganathan
Ranch Hand

Joined: Jun 29, 2009
Posts: 70
Jayaraj Jaganathan wrote:
NOTE: if we need spring transaction then we have to use spring dao.i mean we can't use spring transaction API alone


i am wrong we can use spring transaction alone
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring JDBC Transaction vs Connection ?