-->
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: Update being called without being requested in load?
PostPosted: Mon Oct 11, 2004 12:53 am 
Newbie

Joined: Tue Sep 28, 2004 2:34 pm
Posts: 2
Trying to figure out the why an update being called when it is not requested. I am simply doing a load of the Customer class and receive the error enclosed. Certain account numbers work fine, others do not (all w/ simliar data). I am not sure why an update is attempted...I believe the mappings are correct (a single customer can have many totals and many cards) and the load seems pretty simple...

Has anyone seen similiar behavior or have any ideas? TIA.

Mapping files
Code:
<hibernate-mapping>
    <class name="com.xyz.model.busobj.Customer" table="CUSTOMERS">
   <id name="Code" column="_CODE" type="string">
      <generator class="native"/>
   </id>
   <property name="siteCode" column="SITE_CODE" type="string" length="5"/>
   <property name="staCode" column="STA_CODE" type="short" length="5"/>
   <property name="cnilCode" column="CNIL_CODE" type="string" length="1"/>
   <property name="Dateadd" column="_DATEADD" type="timestamp" length="23"/>
   <property name="Dateupd" column="_DATEUPD" type="timestamp" length="23"/>
   <property name="Phone" column="_PHONE" type="string" length="15"/>
   <property name="Phone2" column="_PHONE2" type="string" length="15"/>
   <property name="Fax" column="_FAX" type="string" length="15"/>
   <property name="Email" column="_EMAIL" type="string" length="40"/>
   <property name="Validity" column="_VALIDITY" type="timestamp" length="23"/>
   <property name="Datexport" column="_DATEXPORT" type="timestamp" length="23"/>
   <property name="Totpts" column="_TOTPTS" type="integer" length="7"/>
   
   <set name="customerTotals" order-by="tot_key asc" >
      <key column="_Code"/>      
      <one-to-many class="com.xyz.model.busobjCustomerTotals"/>
   </set>
   
   <set name="cards" >
      <key column="_Code"/>      
      <one-to-many class="com.xyz.model.busobjCards"/>
   </set>

   <component name="address" class="com.xyz.model.busobjAddress" >
      <property name="address1" column="_ADR1" type="string" length="40"/>
      <property name="address2" column="_ADR2" type="string" length="40"/>
      <property name="address3" column="_ADR3" type="string" length="40"/>
      <property name="city" column="_CITY" type="string" length="30"/>
      <property name="cityCode" column="CTY_CODE" type="string" length="3"/>
      <property name="floor" column="_FLOOR" type="java.lang.Short" length="5" />
      <property name="street" column="_STREET" type="java.lang.Integer" length="10"/>
      <property name="streetCode" column="STREET_CODE" type="java.lang.Short" length="5"/>
      <property name="zip" column="_ZIP" type="string" length="15"/>
   </component>

    </class>
</hibernate-mapping>

<hibernate-mapping>
   <class name="com.xyz.model.busobj.Cards" table="CARDS">
      <id name="cardNo" column="CARD_NO" type="string">
         <generator class="native"/>
      </id>
      <property name="binid" column="BINID" type="short" length="5"/>
      <property name="staCode" column="STA_CODE" type="short" length="5"/>
      <property name="titlecode" column="TITLECODE" type="short" length="5"/>
      <property name="Code" column="_CODE" type="string" length="20"/>
      <property name="lngcode" column="LNGCODE" type="string" length="4"/>
      <property name="cardName" column="CARD_NAME" type="string" length="40"/>
      <property name="cardFname" column="CARD_FNAME" type="string" length="30"/>
      <property name="cardInitdate" column="CARD_INITDATE" type="timestamp" length="23"/>
      <property name="cardValidity" column="CARD_VALIDITY" type="timestamp" length="23"/>
      <property name="cardPin" column="CARD_PIN" type="string" length="8"/>
   </class>
</hibernate-mapping>

<hibernate-mapping>
   <class name="com.xyz.model.busobj.CustomerTotals" table="CUSTOMER_TOTALS">
      <composite-id>
         <key-property name="Code" column="_CODE" type="string" length="20" />
         <key-property name="totKey" column="TOT_KEY" type="string" length="3"/>
         <key-property name="totPeriode" column="TOT_PERIODE" type="string" length="2"/>
      </composite-id>
      <property name="totDate" column="TOT_DATE" type="timestamp" length="23"
         not-null="true"/>
      <property name="totValue" column="TOT_VALUE" type="double" length="19"/>
      <property name="totDatupdate" column="TOT_DATUPDATE" type="timestamp" length="23"/>
   </class>
</hibernate-mapping>


The main code is a simple load (Using Spring to initialize elsewhere...)

Code:
customer = (Customer) getHibernateTemplate().load(Customer.class, accountNumber);


I would not expect this code to produce the following trace;

Code:
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.loader.Loader] - <total objects hydrated: 7>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <resolving associations for [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@8eae04[cstCode=123                 ,csttotKey=BON,csttotPeriode=TR,csttotDate=<null>,csttotValue=0.0,csttotDatupdate=<null>]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <done materializing entity [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@8eae04[cstCode=123                 ,csttotKey=BON,csttotPeriode=TR,csttotDate=2003-10-17 14:02:54.653,csttotValue=0.0,csttotDatupdate=2003-10-17 14:02:54.653]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <resolving associations for [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@d964af[cstCode=123                 ,csttotKey=COU,csttotPeriode=TR,csttotDate=<null>,csttotValue=0.0,csttotDatupdate=<null>]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <done materializing entity [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@d964af[cstCode=123                 ,csttotKey=COU,csttotPeriode=TR,csttotDate=2003-10-17 14:02:54.653,csttotValue=0.0,csttotDatupdate=2003-10-17 14:02:54.653]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <resolving associations for [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@7f8062[cstCode=123                 ,csttotKey=CPE,csttotPeriode=TR,csttotDate=<null>,csttotValue=0.0,csttotDatupdate=<null>]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <done materializing entity [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@7f8062[cstCode=123                 ,csttotKey=CPE,csttotPeriode=TR,csttotDate=2003-10-17 14:02:54.653,csttotValue=0.0,csttotDatupdate=2003-10-17 14:02:54.653]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <resolving associations for [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@1adb7b8[cstCode=123                 ,csttotKey=PME,csttotPeriode=TR,csttotDate=<null>,csttotValue=0.0,csttotDatupdate=<null>]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <done materializing entity [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@1adb7b8[cstCode=123                 ,csttotKey=PME,csttotPeriode=TR,csttotDate=2003-10-17 14:02:54.653,csttotValue=0.0,csttotDatupdate=2003-10-17 14:02:54.653]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <resolving associations for [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@3e5a91[cstCode=123                 ,csttotKey=PTS,csttotPeriode=TR,csttotDate=<null>,csttotValue=0.0,csttotDatupdate=<null>]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <done materializing entity [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@3e5a91[cstCode=123                 ,csttotKey=PTS,csttotPeriode=TR,csttotDate=2003-10-17 14:02:54.653,csttotValue=0.0,csttotDatupdate=2003-10-17 14:02:54.653]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <resolving associations for [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@ee6ad6[cstCode=123                 ,csttotKey=RED,csttotPeriode=TR,csttotDate=<null>,csttotValue=0.0,csttotDatupdate=<null>]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <done materializing entity [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@ee6ad6[cstCode=123                 ,csttotKey=RED,csttotPeriode=TR,csttotDate=2003-10-17 14:02:54.653,csttotValue=0.0,csttotDatupdate=2003-10-17 14:02:54.653]]>
2004-10-10 22:32:00,921 DEBUG [net.sf.hibernate.impl.SessionImpl] - <resolving associations for [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@15fc672[cstCode=123                 ,csttotKey=REM,csttotPeriode=TR,csttotDate=<null>,csttotValue=0.0,csttotDatupdate=<null>]]>
2004-10-10 22:32:00,937 DEBUG [net.sf.hibernate.impl.SessionImpl] - <done materializing entity [com.xyz.model.busobj.CustomerTotals#com.xyz.model.busobj.CustomerTotals@15fc672[cstCode=123                 ,csttotKey=REM,csttotPeriode=TR,csttotDate=2003-10-17 14:02:54.653,csttotValue=0.0,csttotDatupdate=2003-10-17 14:02:54.653]]>
2004-10-10 22:32:00,937 DEBUG [net.sf.hibernate.impl.SessionImpl] - <2 collections were found in result set>
2004-10-10 22:32:00,937 DEBUG [net.sf.hibernate.impl.SessionImpl] - <collection fully initialized: [com.xyz.model.busobj.Customer.customerTotals#123                 ]>
2004-10-10 22:32:00,937 DEBUG [net.sf.hibernate.impl.SessionImpl] - <collection fully initialized: [com.xyz.model.busobj.Customer.customerTotals#123]>
2004-10-10 22:32:00,937 DEBUG [net.sf.hibernate.impl.SessionImpl] - <2 collections initialized>
2004-10-10 22:32:00,937 DEBUG [net.sf.hibernate.impl.SessionImpl] - <collection initialized>
2004-10-10 22:32:00,968 DEBUG [org.springframework.orm.hibernate.HibernateTemplate] - <Eagerly flushing Hibernate session>
2004-10-10 22:32:00,968 DEBUG [net.sf.hibernate.impl.SessionImpl] - <flushing session>
2004-10-10 22:32:00,968 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Flushing entities and processing referenced collections>
2004-10-10 22:32:01,156 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Collection found: [com.xyz.model.busobj.Customer.customerTotals#123], was: [com.xyz.model.busobj.Customer.customerTotals#123]>
2004-10-10 22:32:01,156 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Collection found: [com.xyz.model.busobj.Customer.cards#123], was: [com.xyz.model.busobj.Customer.cards#123]>
2004-10-10 22:32:01,156 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Processing unreferenced collections>
2004-10-10 22:32:01,156 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Collection dereferenced: [com.xyz.model.busobj.Customer.customerTotals#123                 ]>
2004-10-10 22:32:01,156 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Scheduling collection removes/(re)creates/updates>
2004-10-10 22:32:01,296 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Flushed: 0 insertions, 0 updates, 0 deletions to 8 objects>
2004-10-10 22:32:01,296 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Flushed: 0 (re)creations, 0 updates, 1 removals to 3 collections>
2004-10-10 22:32:01,343 DEBUG [net.sf.hibernate.impl.Printer] - <listing entities:>
2004-10-10 22:32:01,343 DEBUG [net.sf.hibernate.impl.Printer] - <com.xyz.model.busobj.CustomerTotals{csttotDatupdate=17 October 2003 14:02:54, csttotValue=0.0, csttotDate=17 October 2003 14:02:54}>
2004-10-10 22:32:01,343 DEBUG [net.sf.hibernate.impl.Printer] - <com.xyz.model.busobj.CustomerTotals{csttotDatupdate=17 October 2003 14:02:54, csttotValue=0.0, csttotDate=17 October 2003 14:02:54}>
2004-10-10 22:32:01,343 DEBUG [net.sf.hibernate.impl.Printer] - <com.xyz.model.busobj.CustomerTotals{csttotDatupdate=17 October 2003 14:02:54, csttotValue=0.0, csttotDate=17 October 2003 14:02:54}>
2004-10-10 22:32:01,343 DEBUG [net.sf.hibernate.impl.Printer] - <com.xyz.model.busobj.CustomerTotals{csttotDatupdate=17 October 2003 14:02:54, csttotValue=0.0, csttotDate=17 October 2003 14:02:54}>
2004-10-10 22:32:01,343 DEBUG [net.sf.hibernate.impl.Printer] - <com.xyz.model.busobj.CustomerTotals{csttotDatupdate=17 October 2003 14:02:54, csttotValue=0.0, csttotDate=17 October 2003 14:02:54}>
2004-10-10 22:32:01,390 DEBUG [net.sf.hibernate.impl.Printer] - <com.xyz.model.busobj.Customer{cstDateupd=17 October 2003 00:00:00, siteCode=00005, cstPhone=01 88 22 43 23 , cstDatexport=null, address=null, cstValidity=01 January 2010 00:00:00, cstDateadd=17 October 2003 00:00:00, cstEmail=S2SYSTEMS@S2SYSTEMS.COM, cstPhone2=06 23 32 23 67 , customerTotals=[], cstTotpts=600, cards=[], cnilCode=0, cstFax=01 88 22 43 23 , staCode=1, cstCode=123}>
2004-10-10 22:32:01,390 DEBUG [net.sf.hibernate.impl.Printer] - <com.xyz.model.busobj.CustomerTotals{csttotDatupdate=17 October 2003 14:02:54, csttotValue=0.0, csttotDate=17 October 2003 14:02:54}>
2004-10-10 22:32:01,390 DEBUG [net.sf.hibernate.impl.Printer] - <com.xyz.model.busobj.CustomerTotals{csttotDatupdate=17 October 2003 14:02:54, csttotValue=0.0, csttotDate=17 October 2003 14:02:54}>
2004-10-10 22:32:01,390 DEBUG [net.sf.hibernate.impl.SessionImpl] - <executing flush>
2004-10-10 22:32:01,390 DEBUG [net.sf.hibernate.collection.BasicCollectionPersister] - <Deleting collection: [com.xyz.model.busobj.Customer.customerTotals#123                 ]>
2004-10-10 22:32:01,390 DEBUG [net.sf.hibernate.impl.BatcherImpl] - <about to open: 0 open PreparedStatements, 0 open ResultSets>
2004-10-10 22:32:01,406 DEBUG [net.sf.hibernate.SQL] - <update CUSTOMER_TOTALS set cst_Code=null where cst_Code=?>
Hibernate: update CUSTOMER_TOTALS set cst_Code=null where cst_Code=?
2004-10-10 22:32:01,406 DEBUG [net.sf.hibernate.impl.BatcherImpl] - <preparing statement>
2004-10-10 22:32:01,406 DEBUG [net.sf.hibernate.type.StringType] - <binding '123                 ' to parameter: 1>
2004-10-10 22:32:01,500 DEBUG [net.sf.hibernate.impl.BatcherImpl] - <done closing: 0 open PreparedStatements, 0 open ResultSets>
2004-10-10 22:32:01,500 DEBUG [net.sf.hibernate.impl.BatcherImpl] - <closing statement>
2004-10-10 22:32:01,562 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] - <SQL Exception>
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'CST_CODE', table 'XYZ.dbo.CUSTOMER_TOTALS'; column does not allow nulls. UPDATE fails.
   at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
   at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
   at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
   at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
   at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
   at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
   at net.sf.hibernate.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:500)
   at net.sf.hibernate.impl.ScheduledCollectionRemove.execute(ScheduledCollectionRemove.java:22)
   at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2382)
   at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2337)
   at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)
   at org.springframework.orm.hibernate.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:202)
   at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:151)
   at org.springframework.orm.hibernate.HibernateTemplate.load(HibernateTemplate.java:196)
   at com.xyz.model.dao.hibernate.CustomerDaoHibernateImpl.getCustomer(CustomerDaoHibernateImpl.java:66)
   at com.xyz.model.service.impl.CustomerServiceImpl.getCustomer(CustomerServiceImpl.java:54)
   at com.xyz.model.dao.hibernate.CustomerDaoHibernateImpl.main(CustomerDaoHibernateImpl.java:87)
2004-10-10 22:32:01,578 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQL Error: 515, SQLState: HY000>
2004-10-10 22:32:01,578 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'CST_CODE', table 'XYZ.dbo.CUSTOMER_TOTALS'; column does not allow nulls. UPDATE fails.>
2004-10-10 22:32:01,578 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQL Error: 3621, SQLState: HY000>
2004-10-10 22:32:01,578 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The statement has been terminated.>
2004-10-10 22:32:01,578 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <could not delete collection: [com.xyz.model.busobj.Customer.customerTotals#123                 ]>
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'CST_CODE', table 'XYZ.dbo.CUSTOMER_TOTALS'; column does not allow nulls. UPDATE fails.
   at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
   at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
   at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
   at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
   at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
   at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
   at net.sf.hibernate.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:500)
   at net.sf.hibernate.impl.ScheduledCollectionRemove.execute(ScheduledCollectionRemove.java:22)
   at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2382)
   at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2337)
   at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)
   at org.springframework.orm.hibernate.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:202)
   at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:151)
   at org.springframework.orm.hibernate.HibernateTemplate.load(HibernateTemplate.java:196)
   at com.xyz.model.dao.hibernate.CustomerDaoHibernateImpl.getCustomer(CustomerDaoHibernateImpl.java:66)
   at com.xyz.model.service.impl.CustomerServiceImpl.getCustomer(CustomerServiceImpl.java:54)
   at com.xyz.model.dao.hibernate.CustomerDaoHibernateImpl.main(CustomerDaoHibernateImpl.java:87)
2004-10-10 22:32:01,578 ERROR [net.sf.hibernate.impl.SessionImpl] - <Could not synchronize database state with session>
net.sf.hibernate.JDBCException: could not delete collection: [com.xyz.model.busobj.Customer.customerTotals#123                 ]
   at net.sf.hibernate.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:510)
   at net.sf.hibernate.impl.ScheduledCollectionRemove.execute(ScheduledCollectionRemove.java:22)
   at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2382)
   at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2337)
   at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)
   at org.springframework.orm.hibernate.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:202)
   at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:151)
   at org.springframework.orm.hibernate.HibernateTemplate.load(HibernateTemplate.java:196)
   at com.xyz.model.dao.hibernate.CustomerDaoHibernateImpl.getCustomer(CustomerDaoHibernateImpl.java:66)
   at com.xyz.model.service.impl.CustomerServiceImpl.getCustomer(CustomerServiceImpl.java:54)
   at com.xyz.model.dao.hibernate.CustomerDaoHibernateImpl.main(CustomerDaoHibernateImpl.java:87)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'CST_CODE', table 'XYZ.dbo.CUSTOMER_TOTALS'; column does not allow nulls. UPDATE fails.
   at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
   at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
   at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
   at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
   at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
   at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
   at net.sf.hibernate.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:500)
   ... 10 more



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.