In the web-app, I guess you must be using data source to get the connection. Are you using any jdbc framework like spring/hibernate?
love your job and not your company;
...because you never know when your company will stop loving you!
RamandeepS Singh
Ranch Hand
Joined: Aug 25, 2009
Posts: 60
posted
0
hi..
Thanks for your reply first
No i m not using any of the frameworks
Thanks
Ramandeep S
manoj r patil
Ranch Hand
Joined: Jun 06, 2002
Posts: 180
posted
0
In that case, I would suggest to use one connection for one transaction. So essentially transaction can not be spanned across multiple sessions but certainly it can span across multiple requests.
In that case, I would suggest to use one connection for one transaction. So essentially transaction can not be spanned across multiple sessions but certainly it can span across multiple requests.
It's possible you mean the right thing, but the wording as it is is not correct (or at the least highly misleading). Transactions really do not figure into this. The usual way to do this would be to maintain a DB connection pool for the web app, and then to obtain a connection from it if a request comes in that needs DB access. After the request is completed, the connection should be returned to the pool. Open connections should *not* be stored in sessions - you'd run out of connections pretty quickly.