Up to now I have assumed that things work as you explained. However opening
new connections is typically a fairly slow business. When programming in C
or Perl one gets used to using the same connection over and over again,
processing transactions in a loop. This does not appear to be possible with
Java, which severely limits the rate at which one can process data.

This limitation on transaction rate is not a problem at present, but it may
well become so later. For the moment I am just being curious about how the
connection pool is managed.





|---------+---------------------------->
|         |           "Thomas Fischer" |
|         |           <[EMAIL PROTECTED]|
|         |           u.net>           |
|         |                            |
|         |                            |
|         |           27-Aug-2004 11:11|
|         |           Please respond to|
|         |           "Apache Torque   |
|         |           Users List"      |
|         |           <[EMAIL PROTECTED]|
|         |           pache.org>       |
|         |                            |
|---------+---------------------------->
  
>-------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                     |
  |                                                                                    
                                     |
  |                                                                                    
                                     |
  |       To:      "Apache Torque Users List" <[EMAIL PROTECTED]>                      
                             |
  |                                                                                    
                                     |
  |       cc:                                                                          
                                     |
  |       Subject: Re: Releasing DB connections                                        
                                     |
  
>-------------------------------------------------------------------------------------------------------------------------|







Hi,

I have no idea whether you can do any tricks to use a connection for more
than one transaction, but I do not see why you should want to (except you
want to save work for the pool) ?

If you do not have any strong reason for not using the Transaction object
for getting/releasing your connection, I would recommend to use
Transaction; seems to be the standard way to me.
But perhaps someone else has a better idea.

      Thomas


[EMAIL PROTECTED] schrieb am 27.08.2004 12:00:39:

> So you are saying that one cannot do more than one transaction with a
> connection. Surely commit/rollback is a separate matter from saying, 'I
> have finished with this connections, now let someone else use it'?
>
>
> Of course, I can close the connection, which will force the pool manager
to
> create a new one, but that is not what I am after.
>
>
> Hi,
>
> personally I use Transaction.begin() to get a connection and
> Transaction.commit(connection) , transaction.rollback(connection) or
> transaction.safeRollback(connection) to give it back to the pool.
>
>    Thomas
>
> [EMAIL PROTECTED] schrieb am 27.08.2004 10:21:11:
>
> > A bit of clarification please.
> >
> > One uses torque.getConnection to get a DB connection from the pool. How
> and
> > when is it returned to the pool?
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]









---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to