what happens if we dont use a pooling in a web based application?
if a pooling is a logic of one connection for one user what happens if two user uses same connection instance?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35258
7
posted
0
The benefit is avoiding the overhead of opening connections, which are network operations nad potentially time- and resource-consuming.
If you don't use them, you don't get that benefit. And since all serious JDBC drivers come with pooling built-in these days, there's very little work required in using them. Your logic will need to ensure that you return connections to the pool once you're done with them, of course.
Pooling does not mean "one user - one connection", but potentially "many users - one connection". Connections would not be used simultaneously by two users. One user would get a connection from the pool, use it, and then return it to the pool. It would be a bad thing if two users would use the same connection at the same time, possibly even within transactions.
Originally posted by sinasi susam: what happens if two user uses same connection instance?
Nothing, all would be fine. Unless they use it simultaneously.
sinasi susam
Ranch Hand
Joined: Jul 15, 2005
Posts: 67
posted
0
I can realize that it will be problem when rolling back with the method of Connection class.
if our jobs were not transactional so there will not be problem right?
How many statements can we create from a connection? Can we create how much we want?Is it up to us or its limited?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35258
7
posted
0
You can create as many statements through a connection as you like, though not simultaneously, only in succession. And it doesn't matter if they're made by different users, as long as they're not transactional.