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?

Regards,
Dinesh

--- On Mon, 15/2/10, Donald McLean <[email protected]> wrote:

From: Donald McLean <[email protected]>
Subject: Re: 'ERROR 40XD0: Container has been closed.: java.io.IOException'.
To: "Derby Discussion" <[email protected]>
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.


Donald

On Mon, Feb 15, 2010 at 2:33 AM, Dinesh Bajaj <[email protected]> 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:
http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288




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

Reply via email to