BoneCP spring issue

Ask around here!

BoneCP spring issue

Postby pankaj » Mon Apr 02, 2012 9:19 am

I am using spring with BoneCP. In my application I want certain calls to DB to be executed in the same transaction but from the getConnection call I am getting always a different connection may be due to the connection pool.

When I use BasicDataSource instead of BoneCP the DB calls are executed in the same transaction.

Any ideas of resolving this issue.
pankaj
 
Posts: 1
Joined: Mon Apr 02, 2012 9:11 am

Re: BoneCP spring issue

Postby dbaldes » Mon Apr 02, 2012 1:36 pm

You need to keep one specific connection object during your transaction. You cannot call getConnection() multiple times and assume that you get the same connection. It's not meant to be used like that.
dbaldes
 
Posts: 5
Joined: Tue Jul 05, 2011 3:37 pm


Return to BoneCP - Help, Q&A, Whatever!

Who is online

Users browsing this forum: No registered users and 2 guests