db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dinesh Bajaj <dinesh.ba...@ymail.com>
Subject Re: 'ERROR 40XD0: Container has been closed.: java.io.IOException'.
Date Mon, 15 Feb 2010 14:04:06 GMT
Hi Donald,

Thanks for your reply.

I am afraid that I couldn't fully understood your reply. What could I understand, I tried
to translate that into action by setting the conn.setAutoCommit(false) of the connection object
before calling conn.preparedStatement(sql), and then calling calling conn.commit() after preparedStatement.executeUpdate(),
but the exception still occurs.

Could you suggest what code change(s) should I make to fix this?


--- On Mon, 15/2/10, Donald McLean <dmclean62@gmail.com> wrote:

From: Donald McLean <dmclean62@gmail.com>
Subject: Re: 'ERROR 40XD0: Container has been closed.: java.io.IOException'.
To: "Derby Discussion" <derby-user@db.apache.org>
Date: Monday, 15 February, 2010, 6:45 PM

When working with BLOBs and CLOBs, these sorts of errors are almost always caused by committed
transactions. Since most people don't expect to need a transaction
 for a select, more often than not autocommit is set to TRUE and the select commits as soon
as it is executed. While this is fine for everything else, it doesn't work for BLOB/CLOB fields.
A BLOB/CLOB is only valid inside a single transaction and the instant that transaction finished
(commit or rollback) the BLOB/CLOB goes poof.


On Mon, Feb 15, 2010 at 2:33 AM, Dinesh Bajaj <dinesh.bajaj@ymail.com> wrote:

I get the above error while executing the Update statement through a java application. The
error occurs when the update statement involves a Blob field. 

I have ensured that input stream being given to setBinaryStream method is not closed and the
length being given is also correct.

Also, may I say that I can't find any source where I can readily find the detailed description
of a Derby error and its possible causes. The reference documentation just cryptically says
: "Container has been closed". Now, what can be make out of this?

Family photographs are a critical legacy for
ourselves and our descendants. Protect that
legacy with a digital backup and recovery plan.

Join the photo preservation advocacy Facebook group:

      Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! http://downloads.yahoo.com/in/internetexplorer/
View raw message