-->
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.  [ 15 posts ] 
Author Message
 Post subject: Hibernate trying to insert row with NULL id
PostPosted: Fri Jul 16, 2004 7:45 pm 
Regular
Regular

Joined: Wed Jun 30, 2004 4:02 pm
Posts: 64
I normally try to isolate a small block of code causing the problem, rather than have people read a pile of code pasted in, but the guidelines request a lot, so here goes.

I don't think you need to read most of what I'll paste in. To summarize, I am building a struts/spring/hibernate app, closely following the docs and examples from AppFuse, SpringPizza, and The orielly book Hibernate developer's handbook. (Hibernate in action is preordered from Amazon ;)

I can retrieve any data without a problem. However I cannot save a new row without a null being used as the key.

In a nutshell, if I use the code:

Configuration config = new Configuration();
config.addClass(SalesRegion.class).addClass(Customer.class);
sessionFactory = config.buildSessionFactory();

It will work. If I use:

sessionFactory = template.getSessionFactory();

It fails. Here is the relevant log excerpt:

Code:
[srt] INFO [http8080-Processor24] SaveCustomerAdminAction.executeAction(?) | ************* Customer is *************** com.qualcomm.qct.srt.model.Customer@1e8f2a0[id=<null>,name=Test2,salesRegion=com.qualcomm.qct.srt.model.SalesRegion@1fc9fee[id=11,name=Japan]]
[srt] INFO [http8080-Processor24] CustomerDaoHibernate.saveCustomer(?) | ***** SESSIONFACTORY = net.sf.hibernate.impl.SessionFactoryImpl@90f19c
[srt] DEBUG [http8080-Processor24] SessionImpl.<init>(555) | opened session
[srt] INFO [http8080-Processor24] CustomerDaoHibernate.saveCustomer(?) | ***** SESSION = net.sf.hibernate.impl.SessionImpl@1e67280
[srt] DEBUG [http8080-Processor24] JDBCTransaction.begin(37) | begin
[srt] DEBUG [http8080-Processor24] JDBCTransaction.begin(41) | current autocommit status:true
[srt] DEBUG [http8080-Processor24] JDBCTransaction.begin(43) | disabling autocommit
[srt] INFO [http8080-Processor24] CustomerDaoHibernate.saveCustomer(?) | ***** TX = net.sf.hibernate.transaction.JDBCTransaction@675039
[srt] DEBUG [http8080-Processor24] SessionImpl.doSave(825) | saving [com.qualcomm.qct.srt.model.Customer#<null>]
[srt] DEBUG [http8080-Processor24] SessionImpl.executeInserts(2305) | executing insertions
[srt] DEBUG [Finalizer] SessionImpl.finalize(3384) | running Session.finalize()
[srt] DEBUG [http8080-Processor24] Cascades$15.isUnsaved(341) | id unsaved-value strategy NULL
[srt] DEBUG [http8080-Processor24] EntityPersister.insert(490) | Inserting entity: com.qualcomm.qct.srt.model.Customer (native id)
[srt] DEBUG [http8080-Processor24] BatcherImpl.logOpenPreparedStatement(196) | about to open: 0 open PreparedStatements, 0 open ResultSets
[srt] DEBUG [http8080-Processor24] BatcherImpl.getPreparedStatement(237) | insert into CUSTOMER (NAME, SALES_REGION_ID, ERP_CUSTOMER_ID, ACTIVE_FLAG, ID) values (?, ?, ?, ?, null)
Hibernate: insert into CUSTOMER (NAME, SALES_REGION_ID, ERP_CUSTOMER_ID, ACTIVE_FLAG, ID) values (?, ?, ?, ?, null)
[srt] DEBUG [http8080-Processor24] BatcherImpl.getPreparedStatement(241) | preparing statement
[srt] DEBUG [http8080-Processor24] EntityPersister.dehydrate(388) | Dehydrating entity: [com.qualcomm.qct.srt.model.Customer#<null>]
[srt] DEBUG [http8080-Processor24] NullableType.nullSafeSet(46) | binding 'Test2' to parameter: 1
[srt] DEBUG [http8080-Processor24] Cascades$15.isUnsaved(341) | id unsaved-value strategy NULL
[srt] DEBUG [http8080-Processor24] NullableType.nullSafeSet(46) | binding '11' to parameter: 2
[srt] DEBUG [http8080-Processor24] NullableType.nullSafeSet(46) | binding '2' to parameter: 3
[srt] DEBUG [http8080-Processor24] NullableType.nullSafeSet(46) | binding 'true' to parameter: 4
[srt] DEBUG [http8080-Processor24] JDBCExceptionReporter.logExceptions(36) | SQL Exception
java.sql.SQLException: ORA-01400: cannot insert NULL into ("SRT2"."CUSTOMER"."ID")



The relevant method is:

Code:
public void saveCustomer(Customer customer) throws DaoException {

        HibernateTemplate template = getHibernateTemplate();

        Transaction tx = null;
        Session session = null;
        SessionFactory sessionFactory = null;
        try {

            int option = customer.getErpCustomerId().intValue();
            if (option < 4) {
                if (option == 1) { // This works
                    Configuration config = new Configuration();
              config.addClass(SalesRegion.class).addClass(Customer.class);
                    sessionFactory = config.buildSessionFactory();
                } else if (option == 2) { // This fails
                    sessionFactory = template.getSessionFactory();
                } else if (option == 3) { // This fails
                    sessionFactory = getSessionFactory();
                }
                log.info("***** SESSIONFACTORY = " + sessionFactory.toString());
                session = sessionFactory.openSession();
            } else { // This fails
                session = getSession();
            }

            log.info("***** SESSION = " + session.toString());
            tx = session.beginTransaction();
            log.info("***** TX = " + tx.toString());
            session.save(customer);
            log.info("*****NEARLY DONE******");
            tx.commit();
            log.info("***** DONE******");

        } catch (HibernateException e) {
            e.printStackTrace();
            if (tx != null) {
                try {
                    tx.rollback();
                } catch (Exception ee) {
                    ee.printStackTrace();
                }
            }
        } finally {
            // No matter what, close the session
            try {
                session.close();
            } catch (Exception ee) {
                ee.printStackTrace();
            }
        }

        // Clean up after ourselves
        try {
            sessionFactory.close();
        } catch (HibernateException e) {
            e.printStackTrace();
        }


    }



I don't think the following info is necessary, but just in case:

Hibernate v 2.14
Oracle 9i
Jdbc driver is:
Manifest-Version: 1.0
Implementation-Version: "Oracle JDBC Driver version - 10.1.0.2.0"
Specification-Title: "Oracle JDBC driver classes for use with JDK1.
4"
Specification-Version: "Oracle JDBC Driver version - 10.1.0.2.0"
Implementation-Title: "ojdbc14.jar"
Created-By: 1.2.2 (Sun Microsystems Inc.)
Implementation-Time: "Wed Jan 21 00:48:12 2004"
Implementation-Vendor: "Oracle Corporation"
Specification-Vendor: "Oracle Corporation" .



Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
          "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping package="com.qualcomm.qct.srt.model">

    <class name="Customer" table="CUSTOMER">
        <meta attribute="class-description">
A customer/OEM purchasing Qualcomm chips.
This is a generated class!  Do not edit!
@author Ted Bergeron
@version $Id$
        </meta>

        <id name="id" type="java.lang.Integer" column="ID" unsaved-value="null">
            <meta attribute="scope-set">protected</meta>
            <generator class="native"/>
        </id>

        <property name="name" type="string" column="NAME">
            <meta attribute="use-in-tostring">true</meta>
            <column name="NAME" not-null="true" index="CUSTOMER_NAME"/>
        </property>

        <many-to-one name="salesRegion" column="SALES_REGION_ID" class="com.qualcomm.qct.srt.model.SalesRegion">
            <meta attribute="use-in-tostring">true</meta>
        </many-to-one>

        <property name="erpCustomerId" type="java.lang.Integer" column="ERP_CUSTOMER_ID" >
            <meta attribute="use-in-tostring">false</meta>
            <meta attribute="field-description">Customer Id as defined in ERP</meta>
        </property>

        <property name="active" type="boolean" column="ACTIVE_FLAG">
            <meta attribute="use-in-tostring">false</meta>
            <meta attribute="field-description">Active status for the customer</meta>
        </property>

    </class>

    <query name="com.qualcomm.qct.srt.model.customerById">
        <![CDATA[
        from Customer as customer
        where customer.id = :id
        ]]>
    </query>

</hibernate-mapping>


Full Stack Trace:
Code:
[srt] DEBUG [http8080-Processor24] JDBCExceptionReporter.logExceptions(36) | SQL Exception
java.sql.SQLException: ORA-01400: cannot insert NULL into ("SRT2"."CUSTOMER"."ID")

   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
   at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
   at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
   at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543)
   at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028)
   at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
   at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2960)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:528)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
   at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:29)
   at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:932)
   at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
   at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:775)
   at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
   at com.qualcomm.qct.srt.persistence.hibernate.CustomerDaoHibernate.saveCustomer(Unknown Source)
   at com.qualcomm.qct.srt.service.CustomerManagerImpl.saveCustomer(Unknown Source)
   at com.qualcomm.qct.srt.webapp.controller.struts.action.SaveCustomerAdminAction.executeAction(Unknown Source)
   at com.qualcomm.qct.srt.webapp.controller.struts.action.BaseAction.execute(Unknown Source)
   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
   at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
   at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
   at java.lang.Thread.run(Thread.java:534)
[srt] WARN [http8080-Processor24] JDBCExceptionReporter.logExceptions(38) | SQL Error: 1400, SQLState: 23000
[srt] ERROR [http8080-Processor24] JDBCExceptionReporter.logExceptions(46) | ORA-01400: cannot insert NULL into ("SRT2"."CUSTOMER"."ID")

[srt] DEBUG [http8080-Processor24] BatcherImpl.logClosePreparedStatement(203) | done closing: 0 open PreparedStatements, 0 open ResultSets
[srt] DEBUG [http8080-Processor24] BatcherImpl.closePreparedStatement(261) | closing statement
[srt] DEBUG [http8080-Processor24] JDBCExceptionReporter.logExceptions(36) | SQL Exception
java.sql.SQLException: ORA-01400: cannot insert NULL into ("SRT2"."CUSTOMER"."ID")

   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
   at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
   at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
   at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543)
   at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028)
   at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
   at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2960)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:528)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
   at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:29)
   at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:932)
   at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
   at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:775)
   at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
   at com.qualcomm.qct.srt.persistence.hibernate.CustomerDaoHibernate.saveCustomer(Unknown Source)
   at com.qualcomm.qct.srt.service.CustomerManagerImpl.saveCustomer(Unknown Source)
   at com.qualcomm.qct.srt.webapp.controller.struts.action.SaveCustomerAdminAction.executeAction(Unknown Source)
   at com.qualcomm.qct.srt.webapp.controller.struts.action.BaseAction.execute(Unknown Source)
   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
   at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
   at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
   at java.lang.Thread.run(Thread.java:534)
[srt] WARN [http8080-Processor24] JDBCExceptionReporter.logExceptions(38) | SQL Error: 1400, SQLState: 23000
[srt] ERROR [http8080-Processor24] JDBCExceptionReporter.logExceptions(46) | ORA-01400: cannot insert NULL into ("SRT2"."CUSTOMER"."ID")

[srt] ERROR [http8080-Processor24] JDBCException.<init>(38) | could not insert: [com.qualcomm.qct.srt.model.Customer]
java.sql.SQLException: ORA-01400: cannot insert NULL into ("SRT2"."CUSTOMER"."ID")

   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
   at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
   at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
   at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543)
   at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028)
   at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
   at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2960)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:528)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
   at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:29)
   at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:932)
   at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
   at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:775)
   at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
   at com.qualcomm.qct.srt.persistence.hibernate.CustomerDaoHibernate.saveCustomer(Unknown Source)
   at com.qualcomm.qct.srt.service.CustomerManagerImpl.saveCustomer(Unknown Source)
   at com.qualcomm.qct.srt.webapp.controller.struts.action.SaveCustomerAdminAction.executeAction(Unknown Source)
   at com.qualcomm.qct.srt.webapp.controller.struts.action.BaseAction.execute(Unknown Source)
   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
   at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
   at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
   at java.lang.Thread.run(Thread.java:534)
net.sf.hibernate.JDBCException: could not insert: [com.qualcomm.qct.srt.model.Customer]
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:558)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
   at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:29)
   at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:932)
   at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
   at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:775)
   at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
   at com.qualcomm.qct.srt.persistence.hibernate.CustomerDaoHibernate.saveCustomer(Unknown Source)
   at com.qualcomm.qct.srt.service.CustomerManagerImpl.saveCustomer(Unknown Source)
   at com.qualcomm.qct.srt.webapp.controller.struts.action.SaveCustomerAdminAction.executeAction(Unknown Source)
   at com.qualcomm.qct.srt.webapp.controller.struts.action.BaseAction.execute(Unknown Source)
   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
   at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
   at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
   at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SRT2"."CUSTOMER"."ID")

   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
   at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
   at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
   at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543)
   at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028)
   at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
   at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2960)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:528)
   ... 40 more
[srt] DEBUG [http8080-Processor24] JDBCTransaction.rollback(82) | rollback
[srt] DEBUG [http8080-Processor24] SessionImpl.afterTransactionCompletion(585) | transaction completion
[srt] DEBUG [http8080-Processor24] JDBCTransaction.toggleAutoCommit(103) | re-enabling autocommit
[srt] DEBUG [http8080-Processor24] SessionImpl.close(573) | closing session
[srt] DEBUG [http8080-Processor24] SessionImpl.disconnect(3332) | disconnecting session
[srt] DEBUG [http8080-Processor24] SessionImpl.afterTransactionCompletion(585) | transaction completion
[srt] INFO [http8080-Processor24] SessionFactoryImpl.close(531) | closing
[srt] DEBUG [Finalizer] SessionImpl.finalize(3384) | running Session.finalize()


And the debug level log:

[code]
Jul 16, 2004 4:14:22 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /srt from URL file:C:/Program Files/Apache Software Foundation/Tomcat 5.0/webapps/srt
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Environment.<clinit>(462) | Hibernate 2.1.4
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Environment.<clinit>(496) | loaded properties from resource hibernate.properties: {hibernate.connection.username=srt2, hibernate.connection.password=srt24now, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.Oracle9Dialect, hibernate.show_sql=true, hibernate.connection.url=jdbc:oracle:thin:@daniels:1523:qtengdev, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver}
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Environment.<clinit>(522) | using CGLIB reflection optimizer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.Chip -> CHIP
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.AppEngineeringReviewStage -> APPS_ENG_REVIEW_STAGE
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.ArmFrequency -> ARM_FREQUENCY
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.ChipType -> CHIP_TYPE
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.CompetitionSighting -> COMPETITION_SIGHTING
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: competitor -> COMPETITOR_ID, type: com.qualcomm.qct.srt.model.Competitor
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: competitorRegion -> COMPETITOR_REGION__ID, type: com.qualcomm.qct.srt.model.CompetitorRegion
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: industryTechnology -> INDUSTRY_TECHNOLOGY_ID, type: com.qualcomm.qct.srt.model.IndustryTechnology
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: dateModified -> DATE_MODIFIED, type: date
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: informationSource -> INFORMATION_SOURCE, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: comments -> COMMENTS, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.Competitor -> COMPETITOR
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.CompetitorChip -> COMPETITOR_CHIP
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: competitorId -> COMPETITOR_ID, type: com.qualcomm.qct.srt.model.Competitor
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: productId -> PRODUCT_ID, type: com.qualcomm.qct.srt.model.ProductConfig
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: chipTypeId -> CHIP_TYPE_ID, type: com.qualcomm.qct.srt.model.ChipType
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: partNumber -> PART_NUMBER, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: partPrice -> PART_PRICE, type: float
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: partCurrencyId -> PART_CURRENCY_ID, type: com.qualcomm.qct.srt.model.Currency
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: reasonPrice -> REASON_PRICE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: reasonSchedule -> REASON_SCHEDULE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: reasonTechnology -> REASON_TECHNOLOGY_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: reasonOther -> REASON_OTHER_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: comments -> COMMENTS, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.CompetitorRegion -> COMPETITOR_REGION
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.Currency -> CURRENCY
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.Customer -> CUSTOMER
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: salesRegion -> SALES_REGION_ID, type: com.qualcomm.qct.srt.model.SalesRegion
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: erpCustomerId -> ERP_CUSTOMER_ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRoot(1267) | Named query: com.qualcomm.qct.srt.model.customerById ->

from Customer as customer
where customer.id = :id


[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.EditorialNote -> EDITORIAL_NOTE
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: user -> USER_ID, type: com.qualcomm.qct.srt.model.User
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: salesInfo -> SALES_INFO_ID, type: com.qualcomm.qct.srt.model.SalesInfo
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: date -> DATE, type: date
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: comments -> COMMENTS, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.Feature -> FEATURE
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: featureSetId -> FEATURE_SET_ID, type: com.qualcomm.qct.srt.model.FeatureSet
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.FeatureAttribute -> FEATURE_ATTRIBUTE
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: featureId -> FEATURE_ID, type: com.qualcomm.qct.srt.model.Feature
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: featureAttributeTypeId -> FEATURE_ATTRIBUTE_TYPE_ID, type: com.qualcomm.qct.srt.model.FeatureAttributeType
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.FeatureAttributeItem -> FEATURE_ATTRIBUTE_ITEM
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: featureId -> FEATURE_ID, type: com.qualcomm.qct.srt.model.Feature
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: featureAttributeId -> FEATURE_ATTRIBUTE_ID, type: com.qualcomm.qct.srt.model.FeatureAttribute
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.FeatureAttributeType -> FEATURE_ATTRIBUTE_TYPE
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.FeatureSet -> FEATURE_SET
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.FlashChip -> FLASH_CHIP
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: active -> ACTIVE_FLAG, type: boolean
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(20) | trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DTDEntityResolver.resolveEntity(29) | found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
[srt] INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindRootClass(229) | Mapping class: com.qualcomm.qct.srt.model.FrequencyBand -> FREQUENCY_BAND
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: id -> ID, type: integer
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: name -> NAME, type: string
[srt] DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]] Binder.bindProperty(475) | Mapped property: description -> DESCRIPTION, type: string
[srt] DEBUG [ContainerBackgroundProcessor[


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2004 4:10 pm 
Regular
Regular

Joined: Wed Jun 30, 2004 4:02 pm
Posts: 64
bump. Anyone have any ideas about this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2004 5:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Well, you are missing the essential thing: the log of SQL statements executed by Hibernate. I can't see where HIbernate tries to fetch the sequence nextval.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2004 5:28 pm 
Regular
Regular

Joined: Wed Jun 30, 2004 4:02 pm
Posts: 64
That's the thing, if I use the method that works, I will see the select of hibernate_seq.nextval, but in the method that does not work, the sequence is never accessed.


Quote:
In a nutshell, if I use the code:

Configuration config = new Configuration();
config.addClass(SalesRegion.class).addClass(Customer.class);
sessionFactory = config.buildSessionFactory();

It will work. If I use:

sessionFactory = template.getSessionFactory();

it fails.



I tried to compare the .toString() values of SessionFactory, Session and Transaction, but didn't get much info there. [/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 22, 2004 6:03 pm 
Regular
Regular

Joined: Wed Jun 30, 2004 4:02 pm
Posts: 64
Bump. Does anyone have an idea of why hibernate would not get the id from the sequence in this case, instead trying to insert a null id?

Are there any ways to inspect the sessionFactory, session and/or transaction objects, since their toString() methods do not give me any information?

Any help would be greatly appreciated.

Ted


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 26, 2004 2:45 pm 
Regular
Regular

Joined: Wed Jun 30, 2004 4:02 pm
Posts: 64
Bump.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 02, 2004 5:40 pm 
Regular
Regular

Joined: Wed Jun 30, 2004 4:02 pm
Posts: 64
Bump.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 02, 2004 5:47 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Stop doing this. Either someone has time to read all that stuff or you have to simplify and isolate.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 02, 2004 7:53 pm 
Regular
Regular

Joined: Wed Jun 30, 2004 4:02 pm
Posts: 64
I have isolated it to this:

In a nutshell, if I use the code:

Configuration config = new Configuration();
config.addClass(SalesRegion.class).addClass(Customer.class);
sessionFactory = config.buildSessionFactory();

It will work. If I use:

sessionFactory = template.getSessionFactory();

it fails.

Using native key generation, Oracle 9. When it fails, it never selects from hibernate sequence and instead tries to insert a null key.

How much simpler can I make the case? I tried to view the .toString() of SessionFactory, Session and Transaction, but all give no information.

Does anyone have the slightest idea of what I could possibly check to see why this occurs?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 9:43 am 
Beginner
Beginner

Joined: Wed Jul 21, 2004 8:12 pm
Posts: 35
Hello:

I have been experiencing almost a similar problem using DB2 8.1. I had to import the the Hibernate source code into my IDE and run the code in a debug mode. I realized that somehow the id class generator "native" does not generate any id and a "null" value is inserted into the primary key column. However, when I changed the id generator class to "uuid.string" , everything worked (I had to also change my table definition of primary key from Big to varchar). I hope this helps. I have no clue why this is the case. I hope someone would be kind enough to elaborate on this.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 9:47 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Code:
         
                      if ( "native".equals(strategy) ) {
            if ( dialect.supportsIdentityColumns() ) {
               clazz = IdentityGenerator.class;
            }
            else if ( dialect.supportsSequences() ) {
               clazz = SequenceGenerator.class;
            }
            else {
               clazz = TableHiLoGenerator.class;
            }
         }

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 12, 2004 9:30 pm 
Regular
Regular

Joined: Wed Jun 30, 2004 4:02 pm
Posts: 64
tedberg wrote:
I have isolated it to this:

In a nutshell, if I use the code:

Configuration config = new Configuration();
config.addClass(SalesRegion.class).addClass(Customer.class);
sessionFactory = config.buildSessionFactory();

It will work. If I use:

sessionFactory = template.getSessionFactory();

it fails.

Using native key generation, Oracle 9. When it fails, it never selects from hibernate sequence and instead tries to insert a null key.

How much simpler can I make the case? I tried to view the .toString() of SessionFactory, Session and Transaction, but all give no information.

Does anyone have the slightest idea of what I could possibly check to see why this occurs?


Ok, I found the primary problem. The 3 lines of code that worked only referenced hibernate.properties, while the last line using Spring referenced applicationContext.xml. I had left the Hsql dialect active in my xml file, and the Oracle one commented out. (I really should set up the xml file to pull those settings from the properties file as I saw in the Spring Pizza example app)

I still get this behavior in 10% of my cases not 100% as before. I just hope Amazon ships the book soon, and a good read will clear this up for me.

It might be useful to add to a troubleshooting section, if hibernate tries to insert null into the primary key, check the dialect first.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 2:51 pm 
Regular
Regular

Joined: Wed Jun 30, 2004 4:02 pm
Posts: 64
I found the second problem as well. In a few cases I had used:

getHibernateTemplate().save(customer);

instead of:

getHibernateTemplate().saveOrUpdate(customer);

The log output made it difficult to realize this. As my object had a null Id, the save would determine that an Insert was required based on the unsaved-value match. However, it would never set the id from the sequence, and instead try to insert a row with a null primary key.

When I changed to saveOrUpdate, it worked properly.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 6:09 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
but are you sure you know the difference between save and saveOrUpdate, that is more important thant solving this specific use case.
Chack the reference guide + javadoc

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 7:05 pm 
Regular
Regular

Joined: Wed Jun 30, 2004 4:02 pm
Posts: 64
anthony wrote:
but are you sure you know the difference between save and saveOrUpdate, that is more important thant solving this specific use case.
Chack the reference guide + javadoc


I know what the docs say, and because I was only doing inserts at that point, save SHOULD have worked just fine. It was not working, and I noticed that I wanted the method do handle updates also, based on the id and unsaved-value. So I made this change, and now it is working. Based on the docs, it makes no sense to me, but I am happy for now that it is working.

http://www.hibernate.org/hib_docs/api/net/sf/hibernate/Session.html#save(java.lang.Object)


I'd like to trace the hibernate code to determine in detail if I have a misunderstanding of what should be happening, or if there is a possible bug. Unfortunately, I have a project with a tight deadline and can't afford to spend that time right now.

I was hoping a team member would have a hint for me as to why it would issue an insert statement, but not set the id field from the sequence. I am sure over time I will figure all of this out, but for now I have to be content.

Thanks,

Ted


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

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.