Hello,
I'm having a problem on DB2when deleting an object. It seems to be related to the fact the object in question has "all-delete-orphan" collections defined.
The problem does not occur on MySql.
The problem seems to arise when flushing the session\synchronizing the session with the db.
More in particular it seems related to Hibernate trying to execute an update statement.
Following is a small extract of the log produced when running on DB2 (the detailed stack trace is attached further below) and on MySql:
DB2 log extract (see below for full extract):
14:13:35,970 DEBUG SessionImpl:2359 - executing flush
14:13:35,970 DEBUG BasicCollectionPersister:477 - Deleting collection: [com.eds.finframe.esese.persistence.ResolverDefinition.resolverOperandDefinitions#23]
14:13:35,970 DEBUG BatcherImpl:200 - about to open: 0 open PreparedStatements, 0 open ResultSets
14:13:35,970 DEBUG SQL:226 - update LBTBRD01_rod set parentRDUID=null, name=null where parentRDUID=?
14:13:35,970 DEBUG SQL:226 - update LBTBRD01_rod set parentRDUID=null, name=null where parentRDUID=?
14:13:35,970 DEBUG BatcherImpl:249 - preparing statement
14:13:35,970 DEBUG LongType:46 - binding '23' to parameter: 1
14:13:35,970 DEBUG LongType:46 - binding '23' to parameter: 1
14:13:35,980 DEBUG BatcherImpl:207 - done closing: 0 open PreparedStatements, 0 open ResultSets
14:13:35,980 DEBUG BatcherImpl:269 - closing statement
14:13:35,980 DEBUG JDBCExceptionReporter:36 - SQL Exception
14:13:35,980 ERROR JDBCExceptionReporter:38 - could not delete collection: [com.eds.finframe.esese.persistence.ResolverDefinition.resolverOperandDefinitions#23]
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0407N Assignment of a NULL value to a NOT NULL column "NAME" is not allowed. SQLSTATE=23502
When running on MySQL the log shows (see below for full extract):
...
14:16:37,855 DEBUG SessionImpl:2359 - executing flush
14:16:37,855 DEBUG BasicCollectionPersister:477 - Deleting collection: [com.eds.finframe.esese.persistence.ResolverDefinition.resolverOperandDefinitions#6]
14:16:37,855 DEBUG BatcherImpl:200 - about to open: 0 open PreparedStatements, 0 open ResultSets
14:16:37,855 DEBUG SQL:226 - update LBTBRD01_rod set parentRDUID=null, name=null where parentRDUID=?
14:16:37,855 DEBUG SQL:226 - update LBTBRD01_rod set parentRDUID=null, name=null where parentRDUID=?
14:16:37,855 DEBUG BatcherImpl:249 - preparing statement
14:16:37,855 DEBUG LongType:46 - binding '6' to parameter: 1
14:16:37,855 DEBUG LongType:46 - binding '6' to parameter: 1
14:16:37,855 DEBUG BatcherImpl:28 - Adding to batch
... MySQl continues without exception.
Notice the difference. Just after binding the parameters, DB2 log shows "BatcherImpl:207 - done closing: 0 open ", whereas the MySql log shows "BatcherImpl:28 - Adding to batch".
Do you have any clue why this problem is occuring ?
Kind regards,
Edwin
Hibernate version:
2.1.6
Mapping documents:
RESOLVER DECLARATION:<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<!-- Hibernate mapping for the ResolverDeclaration -->
<class name="com.eds.finframe.esese.persistence.ResolverDeclaration"
table="LBTBRD01_rdcl" optimistic-lock="version"
dynamic-update="true">
<meta attribute="class-description">
Concept, realization and future extensions on this Basic Intellectual Property are under Copyright
|