Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Interfaces Jdbc > Couple of prepa...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 1949 of 1987
Post > Topic >>

Couple of preparedstatement bug suspects

by roy.smith@[EMAIL PROTECTED] ("Roy Smith") May 9, 2008 at 04:54 AM

------=_Part_2994_31954140.1210305294652
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi All

I have an app which inserts rows to a table called messages. During load
testing, I'm looping to insert 10,000 rows.
Intermittentently (around 5% and only after the first 6,000 or so) I'm
getting the following Exception...

org.postgresql.util.PSQLException: This statement has been closed.
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.checkClosed(AbstractJdbc2Statement.java:2442)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.getUpdateCount(AbstractJdbc2Statement.java:495)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:309)
    at com.primetext.tl2000.dataobjects.Messages.insert(Messages.java:566)


This smells like a bug. There are other updates within my loop, and I
can't
promise that I'm closing all statements. Therefore if this bug is being
triggered by me abusing the driver, please confirm and I'll go through all
of my code ensuring that all preparedstatements are being closed.

However, there is a another aspect of this which smells like an even
bigger
bug...
Even though the PreparedStatement.executeUpdate is throwing an exception,
the row *is* being written to the database!!
This can't possibly be valid.

best regards
Roy

------=_Part_2994_31954140.1210305294652
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi All<br><br>I have an app which inserts rows to a table called messages.
During load testing, I&#39;m looping to insert 10,000
rows.<br>Intermittentently (around 5% and only after the first 6,000 or
so) I&#39;m getting the following Exception...<br>
<br>org.postgresql.util.PSQLException: This statement has been
closed.<br>&nbsp;&nbsp;&nbsp; at
org.postgresql.jdbc2.AbstractJdbc2Statement.checkClosed(AbstractJdbc2Statement.java:2442)<br>&nbsp;&nbsp;&nbsp;
at
org.postgresql.jdbc2.AbstractJdbc2Statement.getUpdateCount(AbstractJdbc2Statement.java:495)<br>
&nbsp;&nbsp;&nbsp; at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:309)<br>&nbsp;&nbsp;&nbsp;
at
com.primetext.tl2000.dataobjects.Messages.insert(Messages.java:566)<br><br><br>This
smells like a bug. There are other updates within my loop, and I can&#39;t
promise that I&#39;m closing all statements. Therefore if this bug is
being triggered by me abusing the driver, please confirm and I&#39;ll go
through all of my code ensuring that all preparedstatements are being
closed.<br>
<br>However, there is a another aspect of this which smells like an even
bigger bug...<br>Even though the PreparedStatement.executeUpdate is
throwing an exception, the row *is* being written to the database!!
<br>This can&#39;t possibly be valid.<br>
<br>best regards<br>Roy<br><br>

------=_Part_2994_31954140.1210305294652--
 




 5 Posts in Topic:
Couple of preparedstatement bug suspects
roy.smith@[EMAIL PROTECTE  2008-05-09 04:54:54 
Re: Couple of preparedstatement bug suspects
books@[EMAIL PROTECTED]   2008-05-09 00:14:22 
Re: Couple of preparedstatement bug suspects
roy.smith@[EMAIL PROTECTE  2008-05-09 05:41:29 
Re: Couple of preparedstatement bug suspects
books@[EMAIL PROTECTED]   2008-05-09 15:36:02 
Re: Couple of preparedstatement bug suspects
books@[EMAIL PROTECTED]   2008-05-19 23:16:09 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Tue Jul 8 23:57:19 CDT 2008.