I'm using the latest version of H2, i.e. version 1.3.150 and I get a org.h2.jdbc.JdbcSQLException when updating a VARCHAR2.
The SQL statement is a very simple
UPDATE STAMP_TABLE SET DESCRIPTION='a bit of text' WHERE STAMPID='s/1'
and The table itself has nothing special, just a bunch of VARCHAR2 and a BLOB
It works the first time round and fails the second time with the error message:
Error while renaming file "C:\my\local\path\1.t6.lob.db" to "C:\my\local\path\1.temp.lob.db"
the method that uses the SQL statement is below:
public void updateStampDescription(StampId stampId, String description) throws SQLException { PreparedStatement stmt = null; try { stmt = conn.prepareStatement(UPDATE_STAMP_DESCRIPTION); stmt.setString(1, description); stmt.setSt开发者_运维问答ring(2, stampId.getId()); logger.debug("SQL statement: " + stmt.toString()); stmt.execute(); } catch(SQLException ex){ logger.error("Error while updating table " + STAMPS_TABLE_NAME + ", description column: " + ex.getMessage() ); ex.printStackTrace(); throw ex; } finally { if(stmt!=null) stmt.close(); // Also closes the ResultSet } }
Any idea what's wrong ?
I'll answer my own question:
Actually, the project was sitting on a Dropbox folder and the files were being used by Dropbox at the time, and hence could not be renamed as H2 wanted.
精彩评论