Prepared Statements

Ask around here!

Prepared Statements

Postby amitverma.info » Mon May 23, 2011 7:52 am

Hi

I have a question regarding general use of Prepared Statement along with connection pooling

In our application, a PreparedStatement is created and executed at a later point.So if at the time of execution ,connection associated with the prepared statement is busy with other statements than how this statement will get executed.I have seen the source code of PreparedStatementHandler of BoneCp and it is checking if the connection is not closed at the time of execution, it is not checking if connection is available or not.Please let me know how we can achieve this with BoneCP.

Amit
amitverma.info
 
Posts: 2
Joined: Thu May 19, 2011 4:31 pm

Re: Prepared Statements

Postby wwadge » Mon May 23, 2011 7:58 am

A preparedstatement is always associated with a connection. In other words, you cannot just have a preparedStatement floating around, it's always bound to exactly one connection.

You said: "connection associated with the prepared statement is busy with other statements" but this doesn't make sense at all, a connection is not busy with anything, a connection is just a channel. You could have a bunch of statements all associated with one connection.

Wallace
wwadge
Site Admin
 
Posts: 713
Joined: Mon Oct 19, 2009 7:50 pm


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

Who is online

Users browsing this forum: No registered users and 1 guest