On 1/9/06, Kathey Marsden <[EMAIL PROTECTED]> wrote: > Are the additional round trips just on the first execution of a prepared > statement?
No, it is on every execute of the query/transaction. The numbers are average of several thousand transactions, thus the preparing of the initial statement should not influence much :-) > One difference between our client and the DB2 Universal JDBC Driver is > that JCC "defers prepares" > which means that it waits to prepare the statement until it is first > executed, so can save a single round trip on the first statement > execution. This optimization was the source of many bugs, complexity in > the code, and differences in embedded and client behaviour and not > really that helpful in the common scenario where a statement is prepared > once and executed many times. Knut Anders actually commented on this when he studied the messages that different drives send and he could not see that the JCC driver sent the prepare operation in a separate message. We both agreed that this likely was an optimization, but did not think that for an application using prepared statements "correctly" this would have much impact (but I have seen automagically generated code using prepared statements, one execute of it and then a new prepare of the same statements.... :-( ). Olav
