• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Handling commit/rollback in application

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In my Spring's context file I have defined datasource using:
org.springframework.jdbc.datasource.DriverManagerDataSource

Now in my application code I am taking Connection using dataSource.getConnection();
My qiery is that After running sql quries should I write code to rollback() or commit() manully.
From my understandin g Spring is reponsible for automatically doing so.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are two types of transaction management

Programatic: What you just did.

Declarative: Which will use aop of spring and do comit and rollback for you as per the configuration provided.

Go to the link below, search for the declarative transaction there.
http://static.springsource.org/spring/docs/2.0.x/reference/transaction.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic