-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem in update of many-to-many assoiation
PostPosted: Wed Feb 27, 2008 2:44 am 
Newbie

Joined: Thu Nov 29, 2007 8:17 am
Posts: 3
Hello All,
I am working on Adobe flex, Spring and hibernate.
and the server JBOSS4.

i am sending the mapping classes of the table which are related in many to many relation.

Tables are

1)TRAN_PURCHASE_INDENT

2)view_spare_part

3)TRAN_PURCHASEINDENT_ITEMDETAILS (intermediate table)

this code is working fine for save, but the in update its giving error.

Please go through it. and let me know the problem.


[b]Hibernate version:[/b] hibernate 3

[b]Mapping documents:[/b]
[code]
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">


<hibernate-mapping package="com.compassites.syncon.domain.transactions" >

<class name="PurchaseIndentDetails" table="TRAN_PURCHASE_INDENT">
<id name="iud" column="PK_PURCHASE_INDENT_ID" type="long">
<generator class="identity"/>
</id>

<property name="purchaseIndentNumber" column="PURCHASE_INDENT_NUMBER" type="string" length="25" not-null="true"/>
<many-to-one name="oemMaster" column="FKOEMID" not-null="true" />
<property name="procuredDate" type="date" />
<property name="remarks" type="string" length="250" />

<many-to-one name="createdBy" column="CREATED_BY"/>
<property name="createdDate" column="CREATED_DATE" type="date"/>
<many-to-one name="modifiedBy" column="MODIFIED_BY" />
<property name="modifiedDate" column="MODIFIED_DATE" type="timestamp" />

<set name="spareParts" table="TRAN_PURCHASEINDENT_ITEMDETAILS">
<key column="PURCHASE_INDENT_ID"/>
<one-to-many class="PurchaseIndentItemDetails" />
<filter name="accessLevel" condition="isDeleted=:deletedFlag"/>
</set>

<property name="currentStatus" type="string" length="20" />
<property name="isActive" type="string" length="1" />
<property name="enquiryRequired" column="ENQUIRYREQUIRED" type="string" length="1" />
<property name="isDeleted" type="short" not-null="true"/>
</class>


<class name="PurchaseIndentItemDetails" table="TRAN_PURCHASEINDENT_ITEMDETAILS" mutable="true">

<composite-id name="iud"
class="com.compassites.syncon.domain.transactions.PurchaseIndentItemDetails$Iud">
<key-property name="purchaseIndentId" column="PURCHASE_INDENT_ID" />
<key-property name="sparePartId" column="SPAREPART_ID" />
</composite-id>

<property name="quantityIndent" column="QUANTITY_INDENT" type="integer" not-null="true"/>
<property name="quantityOrdered" column="QUANTITY_ORDERED" type="integer" not-null="true"/>
<property name="isDeleted" type="short" not-null="true"/>

<many-to-one name="purchaseIndent"
insert="false"
update="false"
column ="PURCHASE_INDENT_ID" />


<many-to-one name="sparepart"
insert="false"
update="false"
column="SPAREPART_ID" lazy="false"/>
</class>

<class name="SparePart" table="view_spare_part">
<id name="iud" column="PK_SPAREPART_ID" type="long">
<generator class="identity"/>
</id>
<property column="PARTNAME" name="itemName" type="string" length="50" not-null="true" insert="false" update="false"/>
<property column="PARTCODE" name="itemCode" type="string" length="20" not-null="true" insert="false" update="false"/>
<property column="PARTNUMBER" name="itemNumber" type="string" length="30" not-null="true" insert="false" update="false"/>
<property column="SELLINGPRICE" name="sellingPrice" type="double" not-null="true" insert="false" update="false"/>
<property column="MODEL_ID" name="modelId" type="long" not-null="true" insert="false" update="false"/>
<property column="MODEL_NAME" name="modelName" type="string" not-null="true" length="50" insert="false" update="false"/>
<property column="MACHINE_TYPE_ID" name="machineTypeId" type="long" not-null="true" insert="false" update="false"/>
<property column="OEM_ID" name="oemId" type="long" not-null="true" insert="false" update="false"/>
<property column="OEM_CODE" name="oemCode" type="string" not-null="true" length="50" insert="false" update="false"/>
<property column="OEM_NAME" name="oemName" type="string" not-null="true" length="100" insert="false" update="false"/>
<property name="pricePerUnit" type="double" not-null="true"/>
<property name="isEnquired" column="ISENQURIED" type="short"/>
</class>

</hibernate-mapping>
[/code]


[b]Code :[/b]

[code]





public class PurchaseIndentDaoImpl extends HibernateDaoSupport implements PurchaseIndentDao {

private NextValueDao nextDao;


public PurchaseIndentDetails storePurchaseIndent(PurchaseIndentDetails purchaseIndent) {
try {
long purchaseIndentId = purchaseIndent.getIud();
int result = checkDuplicatePurchaseIndent(purchaseIndentId, purchaseIndent.getPurchaseIndentNumber());
if (result == 1) {
throw new TechnicalException("********Duplicate PurchaseIndent Number. Save or Update on the PurchaseIndent object failed.********");
} else {
Set spareParts = purchaseIndent.getSpareParts();
boolean returnValue = checkEnquiryToOemRequired(spareParts);
if (returnValue) {
purchaseIndent.setEnquiryRequired("Y");
} else {
purchaseIndent.setEnquiryRequired("N");
}
if (purchaseIndentId == 0) {
purchaseIndent.setSpareParts(null);
String purchaseIndentNumber = generatePurchaseIndentNumber(purchaseIndent.getOemMaster().getOemName());
purchaseIndent.setPurchaseIndentNumber(purchaseIndentNumber);
getHibernateTemplate().saveOrUpdate(purchaseIndent);
if (spareParts.size() > 0) {
Iterator itr = spareParts.iterator();
while (itr.hasNext()) {
PurchaseIndentItemDetails indentItemDetails = (PurchaseIndentItemDetails) itr.next();
indentItemDetails.setPurchaseIndent(purchaseIndent);
indentItemDetails.setSparepart(indentItemDetails.getSparepart());
getHibernateTemplate().saveOrUpdate(indentItemDetails);
}
}
return purchaseIndent;

} else {
if (spareParts.size() > 0) {
Iterator itr = spareParts.iterator();
while (itr.hasNext()) {
PurchaseIndentItemDetails indentItemDetails = (PurchaseIndentItemDetails) itr.next();
indentItemDetails.setPurchaseIndent(purchaseIndent);
indentItemDetails.setSparepart(indentItemDetails.getSparepart());
getHibernateTemplate().saveOrUpdate(indentItemDetails);
}
}

// Object[] valArray = {purchaseIndent.getOemMaster(), purchaseIndent.getProcuredDate(), purchaseIndent.getRemarks(), purchaseIndent.getModifiedBy(), purchaseIndent.getModifiedDate(), purchaseIndent.getCurrentStatus(),
// purchaseIndent.getIsActive(), purchaseIndent.getEnquiryRequired(), new Short(purchaseIndent.getIsDeleted())
// };
// String query = "update PurchaseIndentDetails PID set " +
// "PID.oemMaster=? ," +
// "PID.procuredDate=? ," +
// "PID.remarks=? ," +
// "PID.modifiedBy=? ," +
// "PID.modifiedDate=? ," +
// "PID.currentStatus=? ," +
// "PID.isActive=? ," +
// "PID.enquiryRequired=? ," +
// "PID.isDeleted=? " +
// "where PID.iud=" + purchaseIndent.getIud();
// getHibernateTemplate().bulkUpdate(query, valArray);
getHibernateTemplate().saveOrUpdate(purchaseIndent); return purchaseIndent;
}
}
} catch (DataAccessException dataAccessException) {
throw new TechnicalException("Error During saving PurchaseIndent", dataAccessException);
}
}


}

[/code]





[b]Full stack trace of any exception that occurs: [/b]

[code]
<21:00:37:266> <DEBUG> Returning cached instance of singleton bean 'purchaseIndentTxManager'
--------------------------------------------------------------
<21:00:37:266> <DEBUG> Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@12b304b]
--------------------------------------------------------------
<21:00:37:266> <DEBUG> Creating new transaction with name [com.compassites.syncon.service.transactions.PurchaseIndentService.storePurchaseIndent]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
--------------------------------------------------------------
<21:00:37:266> <DEBUG> opened session at timestamp: 12040398372
--------------------------------------------------------------
<21:00:37:266> <DEBUG> Opened new Session [org.hibernate.impl.SessionImpl@6f97cf] for Hibernate transaction
--------------------------------------------------------------
<21:00:37:266> <DEBUG> Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@6f97cf]
--------------------------------------------------------------
<21:00:37:266> <DEBUG> begin
--------------------------------------------------------------
<21:00:37:266> <DEBUG> opening JDBC connection
--------------------------------------------------------------
<21:00:37:266> <DEBUG> Creating new JDBC Connection to [jdbc:mysql://192.168.1.202:3306/spims_db]
--------------------------------------------------------------
<21:00:41:813> <DEBUG> current autocommit status: true
--------------------------------------------------------------
<21:00:41:813> <DEBUG> disabling autocommit
--------------------------------------------------------------
<21:00:41:813> <DEBUG> Exposing Hibernate transaction as JDBC transaction [com.mysql.jdbc.Connection@57a184]
--------------------------------------------------------------
<21:00:41:813> <DEBUG> Bound value [org.springframework.jdbc.datasource.ConnectionHolder@12cf6d3] for key [org.springframework.jdbc.datasource.DriverManagerDataSource@2bc29] to thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:41:813> <DEBUG> Bound value [org.springframework.orm.hibernate3.SessionHolder@100c776] for key [org.hibernate.impl.SessionFactoryImpl@1391a2c] to thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:41:813> <DEBUG> Initializing transaction synchronization
--------------------------------------------------------------
<21:00:41:813> <DEBUG> Getting transaction for [com.compassites.syncon.service.transactions.PurchaseIndentService.storePurchaseIndent]
--------------------------------------------------------------
<21:00:41:813> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <Before saving PurchaseIndent>
--------------------------------------------------------------
<21:00:41:813> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <---------inside store method of purchase indent---------------->
--------------------------------------------------------------
<21:00:41:813> <DEBUG> Retrieved value [org.springframework.orm.hibernate3.SessionHolder@100c776] for key [org.hibernate.impl.SessionFactoryImpl@1391a2c] bound to thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:41:813> <DEBUG> Retrieved value [org.springframework.orm.hibernate3.SessionHolder@100c776] for key [org.hibernate.impl.SessionFactoryImpl@1391a2c] bound to thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:41:813> <DEBUG> Found thread-bound Session for HibernateTemplate
--------------------------------------------------------------
<21:00:41:813> <DEBUG> Retrieved value [org.springframework.orm.hibernate3.SessionHolder@100c776] for key [org.hibernate.impl.SessionFactoryImpl@1391a2c] bound to thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:41:813> <DEBUG> about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
--------------------------------------------------------------
<21:00:41:813> <DEBUG> select this_.PK_PURCHASE_INDENT_ID as PK1_23_0_, this_.PURCHASE_INDENT_NUMBER as PURCHASE2_23_0_, this_.FKOEMID as FKOEMID23_0_, this_.procuredDate as procured4_23_0_, this_.remarks as remarks23_0_, this_.CREATED_BY as CREATED6_23_0_, this_.CREATED_DATE as CREATED7_23_0_, this_.MODIFIED_BY as MODIFIED8_23_0_, this_.MODIFIED_DATE as MODIFIED9_23_0_, this_.currentStatus as current10_23_0_, this_.isActive as isActive23_0_, this_.ENQUIRYREQUIRED as ENQUIRY12_23_0_, this_.isDeleted as isDeleted23_0_ from TRAN_PURCHASE_INDENT this_ where this_.PURCHASE_INDENT_NUMBER=? and this_.PK_PURCHASE_INDENT_ID<>? and this_.isDeleted=?
--------------------------------------------------------------
<21:00:41:828> <DEBUG> about to open ResultSet (open ResultSets: 0, globally: 0)
--------------------------------------------------------------
<21:00:41:828> <DEBUG> about to close ResultSet (open ResultSets: 1, globally: 1)
--------------------------------------------------------------
<21:00:41:828> <DEBUG> about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
--------------------------------------------------------------
<21:00:41:828> <DEBUG> initializing non-lazy collections
--------------------------------------------------------------
<21:00:41:828> <DEBUG> Not closing pre-bound Hibernate Session after HibernateTemplate
--------------------------------------------------------------
<21:00:41:828> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <checkDuplicatePurchaseIndent :The PurchaseIndent is correct.------->>>>>>>>>
--------------------------------------------------------------
<21:00:41:828> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <---------not a duplicate purchase indent number---------------->
--------------------------------------------------------------
<21:00:41:828> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <---------Enquiry required: true---------------->
--------------------------------------------------------------
<21:00:41:828> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <---------existing purchase indent---------------->
--------------------------------------------------------------
<21:00:41:828> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <spareParts.size(): 2>
--------------------------------------------------------------
<21:00:41:828> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <---------purchase indent item ITEMNU001---------------->
--------------------------------------------------------------
<21:00:41:828> <DEBUG> Retrieved value [org.springframework.orm.hibernate3.SessionHolder@100c776] for key [org.hibernate.impl.SessionFactoryImpl@1391a2c] bound to thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:41:828> <DEBUG> Retrieved value [org.springframework.orm.hibernate3.SessionHolder@100c776] for key [org.hibernate.impl.SessionFactoryImpl@1391a2c] bound to thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:41:828> <DEBUG> Found thread-bound Session for HibernateTemplate
--------------------------------------------------------------
<21:00:41:844> <DEBUG> about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
--------------------------------------------------------------
<21:00:41:844> <DEBUG> select purchasein_.PURCHASE_INDENT_ID, purchasein_.SPAREPART_ID, purchasein_.QUANTITY_INDENT as QUANTITY3_24_, purchasein_.QUANTITY_ORDERED as QUANTITY4_24_, purchasein_.isDeleted as isDeleted24_ from TRAN_PURCHASEINDENT_ITEMDETAILS purchasein_ where purchasein_.PURCHASE_INDENT_ID=? and purchasein_.SPAREPART_ID=?
--------------------------------------------------------------
<21:00:41:844> <DEBUG> about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
--------------------------------------------------------------
<21:00:41:860> <DEBUG> Not closing pre-bound Hibernate Session after HibernateTemplate
--------------------------------------------------------------
<21:00:41:860> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <---------purchase indent item ITEMNU002---------------->
--------------------------------------------------------------
<21:00:41:860> <DEBUG> Retrieved value [org.springframework.orm.hibernate3.SessionHolder@100c776] for key [org.hibernate.impl.SessionFactoryImpl@1391a2c] bound to thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:41:860> <DEBUG> Retrieved value [org.springframework.orm.hibernate3.SessionHolder@100c776] for key [org.hibernate.impl.SessionFactoryImpl@1391a2c] bound to thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:41:860> <DEBUG> Found thread-bound Session for HibernateTemplate
--------------------------------------------------------------
<21:00:41:860> <DEBUG> about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
--------------------------------------------------------------
<21:00:41:860> <DEBUG> select purchasein_.PURCHASE_INDENT_ID, purchasein_.SPAREPART_ID, purchasein_.QUANTITY_INDENT as QUANTITY3_24_, purchasein_.QUANTITY_ORDERED as QUANTITY4_24_, purchasein_.isDeleted as isDeleted24_ from TRAN_PURCHASEINDENT_ITEMDETAILS purchasein_ where purchasein_.PURCHASE_INDENT_ID=? and purchasein_.SPAREPART_ID=?
--------------------------------------------------------------
<21:00:41:875> <DEBUG> about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
--------------------------------------------------------------
<21:00:41:875> <DEBUG> Not closing pre-bound Hibernate Session after HibernateTemplate
--------------------------------------------------------------
<21:00:41:875> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <---------about to update purchase indent---------------->
--------------------------------------------------------------
<21:00:41:875> <DEBUG> Retrieved value [org.springframework.orm.hibernate3.SessionHolder@100c776] for key [org.hibernate.impl.SessionFactoryImpl@1391a2c] bound to thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:41:875> <DEBUG> Retrieved value [org.springframework.orm.hibernate3.SessionHolder@100c776] for key [org.hibernate.impl.SessionFactoryImpl@1391a2c] bound to thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:41:875> <DEBUG> Found thread-bound Session for HibernateTemplate
--------------------------------------------------------------
<21:00:41:875> <DEBUG> Not closing pre-bound Hibernate Session after HibernateTemplate
--------------------------------------------------------------
<21:00:41:875> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <---------purchase indent updated 20---------------->
--------------------------------------------------------------
<21:00:41:875> <DEBUG> <http-127.0.0.1-8080-1> <Unavailable stack location> <After Updating PurchaseIndent>
--------------------------------------------------------------
<21:00:41:875> <DEBUG> Completing transaction for [com.compassites.syncon.service.transactions.PurchaseIndentService.storePurchaseIndent]
--------------------------------------------------------------
<21:00:41:875> <DEBUG> Triggering beforeCommit synchronization
--------------------------------------------------------------
<21:00:41:875> <DEBUG> Triggering beforeCompletion synchronization
--------------------------------------------------------------
<21:00:41:875> <DEBUG> Initiating transaction commit
--------------------------------------------------------------
<21:00:41:875> <DEBUG> Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@6f97cf]
--------------------------------------------------------------
<21:00:41:875> <DEBUG> commit
--------------------------------------------------------------
<21:00:41:875> <DEBUG> processing flush-time cascades
--------------------------------------------------------------
<21:00:41:891> <DEBUG> dirty checking collections
--------------------------------------------------------------
<21:00:41:922> <DEBUG> Collection found: [com.compassites.syncon.domain.transactions.PurchaseIndentDetails.spareParts#20], was: [<unreferenced>] (initialized)
--------------------------------------------------------------
<21:00:41:922> <DEBUG> Flushed: 0 insertions, 2 updates, 0 deletions to 3 objects
--------------------------------------------------------------
<21:00:41:922> <DEBUG> Flushed: 1 (re)creations, 0 updates, 1 removals to 1 collections
--------------------------------------------------------------
<21:00:41:922> <DEBUG> listing entities:
--------------------------------------------------------------
<21:00:41:938> <DEBUG> com.compassites.syncon.domain.transactions.PurchaseIndentDetails{createdDate=15 February 2008, currentStatus=null, modifiedBy=com.compassites.syncon.domain.UserSummary#1, enquiryRequired=Y, purchaseIndentNumber=SIS/PI/LI/07-08/2, remarks=Remarks, procuredDate=27 February 2008, createdBy=com.compassites.syncon.domain.UserSummary#1, isActive=null, spareParts=[com.compassites.syncon.domain.transactions.PurchaseIndentItemDetails#component[purchaseIndentId,sparePartId]{sparePartId=8, purchaseIndentId=20}, com.compassites.syncon.domain.transactions.PurchaseIndentItemDetails#component[purchaseIndentId,sparePartId]{sparePartId=9, purchaseIndentId=20}], isDeleted=0, modifiedDate=2008-02-26 21:00:37, oemMaster=com.compassites.syncon.domain.OemSummary#1, iud=20}
--------------------------------------------------------------
<21:00:41:938> <DEBUG> com.compassites.syncon.domain.transactions.PurchaseIndentItemDetails{quantityOrdered=0, sparepart=com.compassites.syncon.domain.SparePart#9, quantityIndent=31, purchaseIndent=com.compassites.syncon.domain.transactions.PurchaseIndentDetails#20, isDeleted=0, iud=component[purchaseIndentId,sparePartId]{sparePartId=9, purchaseIndentId=20}}
--------------------------------------------------------------
<21:00:41:938> <DEBUG> com.compassites.syncon.domain.transactions.PurchaseIndentItemDetails{quantityOrdered=0, sparepart=com.compassites.syncon.domain.SparePart#8, quantityIndent=13, purchaseIndent=com.compassites.syncon.domain.transactions.PurchaseIndentDetails#20, isDeleted=1, iud=component[purchaseIndentId,sparePartId]{sparePartId=8, purchaseIndentId=20}}
--------------------------------------------------------------
<21:00:41:938> <DEBUG> about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
--------------------------------------------------------------
<21:00:41:938> <DEBUG> update TRAN_PURCHASEINDENT_ITEMDETAILS set QUANTITY_INDENT=?, QUANTITY_ORDERED=?, isDeleted=? where PURCHASE_INDENT_ID=? and SPAREPART_ID=?
--------------------------------------------------------------
<21:00:41:953> <DEBUG> Executing batch size: 1
--------------------------------------------------------------
<21:00:41:985> <DEBUG> about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
--------------------------------------------------------------
<21:00:41:985> <DEBUG> about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
--------------------------------------------------------------
<21:00:41:985> <DEBUG> update TRAN_PURCHASE_INDENT set PURCHASE_INDENT_NUMBER=?, FKOEMID=?, procuredDate=?, remarks=?, CREATED_BY=?, CREATED_DATE=?, MODIFIED_BY=?, MODIFIED_DATE=?, currentStatus=?, isActive=?, ENQUIRYREQUIRED=?, isDeleted=? where PK_PURCHASE_INDENT_ID=?
--------------------------------------------------------------
<21:00:41:985> <DEBUG> Executing batch size: 1
--------------------------------------------------------------
<21:00:41:985> <DEBUG> about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
--------------------------------------------------------------
<21:00:41:985> <DEBUG> Deleting collection: [com.compassites.syncon.domain.transactions.PurchaseIndentDetails.spareParts#20]
--------------------------------------------------------------
<21:00:41:985> <DEBUG> about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
--------------------------------------------------------------
<21:00:41:985> <DEBUG> update TRAN_PURCHASEINDENT_ITEMDETAILS set PURCHASE_INDENT_ID=null where PURCHASE_INDENT_ID=?
--------------------------------------------------------------
<21:00:41:985> <DEBUG> done deleting collection
--------------------------------------------------------------
<21:00:41:985> <DEBUG> Executing batch size: 1
--------------------------------------------------------------
<21:00:42:016> <DEBUG> about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
--------------------------------------------------------------
<21:00:42:031> <DEBUG> Could not execute JDBC batch update [update TRAN_PURCHASEINDENT_ITEMDETAILS set PURCHASE_INDENT_ID=null where PURCHASE_INDENT_ID=?]
java.sql.BatchUpdateException: Column was set to data type implicit default; NULL supplied for NOT NULL column 'PURCHASE_INDENT_ID' at row 1
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1540)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:575)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy103.storePurchaseIndent(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:168)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:173)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1165)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:757)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:117)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:48)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:145)
at flex.messaging.endpoints.AMFEndpoint.service(AMFEndpoint.java:122)
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:424)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
--------------------------------------------------------------
<21:00:42:047> <WARN> SQL Error: 1263, SQLState: 22004
--------------------------------------------------------------
<21:00:42:047> <ERROR> Column was set to data type implicit default; NULL supplied for NOT NULL column 'PURCHASE_INDENT_ID' at row 1
--------------------------------------------------------------
<21:00:42:047> <ERROR> Could not synchronize database state with session
org.hibernate.exception.DataException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:575)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy103.storePurchaseIndent(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:168)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:173)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1165)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:757)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:117)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:48)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:145)
at flex.messaging.endpoints.AMFEndpoint.service(AMFEndpoint.java:122)
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:424)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.BatchUpdateException: Column was set to data type implicit default; NULL supplied for NOT NULL column 'PURCHASE_INDENT_ID' at row 1
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1540)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 49 more
--------------------------------------------------------------
<21:00:42:047> <DEBUG> Initiating transaction rollback after commit exception
org.springframework.dao.InvalidDataAccessResourceUsageException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.DataException: Could not execute JDBC batch update
Caused by:
org.hibernate.exception.DataException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:575)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy103.storePurchaseIndent(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:168)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:173)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1165)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:757)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:117)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:48)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:145)
at flex.messaging.endpoints.AMFEndpoint.service(AMFEndpoint.java:122)
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:424)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.BatchUpdateException: Column was set to data type implicit default; NULL supplied for NOT NULL column 'PURCHASE_INDENT_ID' at row 1
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1540)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 49 more
--------------------------------------------------------------
<21:00:42:047> <DEBUG> Rolling back Hibernate transaction on Session [org.hibernate.impl.SessionImpl@6f97cf]
--------------------------------------------------------------
<21:00:42:047> <DEBUG> rollback
--------------------------------------------------------------
<21:00:42:110> <DEBUG> re-enabling autocommit
--------------------------------------------------------------
<21:00:42:110> <DEBUG> rolled back JDBC Connection
--------------------------------------------------------------
<21:00:42:110> <DEBUG> transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
--------------------------------------------------------------
<21:00:42:110> <DEBUG> Triggering afterCompletion synchronization
--------------------------------------------------------------
<21:00:42:110> <DEBUG> Clearing transaction synchronization
--------------------------------------------------------------
<21:00:42:110> <DEBUG> Removed value [org.springframework.orm.hibernate3.SessionHolder@100c776] for key [org.hibernate.impl.SessionFactoryImpl@1391a2c] from thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:42:235> <DEBUG> Removed value [org.springframework.jdbc.datasource.ConnectionHolder@12cf6d3] for key [org.springframework.jdbc.datasource.DriverManagerDataSource@2bc29] from thread [http-127.0.0.1-8080-1]
--------------------------------------------------------------
<21:00:42:235> <DEBUG> Closing Hibernate Session [org.hibernate.impl.SessionImpl@6f97cf] after transaction
--------------------------------------------------------------
<21:00:42:235> <DEBUG> Closing Hibernate Session
--------------------------------------------------------------
<21:00:42:235> <DEBUG> releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
--------------------------------------------------------------
<21:00:42:235> <DEBUG> transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
--------------------------------------------------------------

[/code]

[b]Name and version of the database you are using:[/b]
My Sql


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.