Subject | RE: [Firebird-Java] Re: Connection Pooling in JBird1.5rc3 |
---|---|
Author | Steffen Heil |
Post date | 2004-06-06T15:28:40Z |
Hi
Not exactly.
What I mean is the following:
Assume, I have code, that prepares a statement (on a certain connection).
Uses it and finally closes that statement and connection.
I see, that the connection is not really closed, but returned to the pool.
Now assume, that code is run again.
Because of transparent statement pooling, the already prepared statement
will be used again - but it is already closed!
What will happen here?
Okay.
Thanks, once again.
Regards,
Steffen
> > What if the statement which originally prepared the statement is closed?any subsequent operation on the closed statement results in SQLException.
> I think you mean connection. in this case all statements are closed too.
Not exactly.
What I mean is the following:
Assume, I have code, that prepares a statement (on a certain connection).
Uses it and finally closes that statement and connection.
I see, that the connection is not really closed, but returned to the pool.
Now assume, that code is run again.
Because of transparent statement pooling, the already prepared statement
will be used again - but it is already closed!
What will happen here?
> if you specify maxStatements property, only the specified number ofprepared statements will be kept in cache.
Okay.
> see DataSource.getConnection(String, String) method.I will.
Thanks, once again.
Regards,
Steffen