-->
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.  [ 6 posts ] 
Author Message
 Post subject: Failed Batch update from HSQLDB?
PostPosted: Fri Oct 29, 2004 12:45 am 
Newbie

Joined: Tue Sep 28, 2004 12:56 pm
Posts: 9
I have following errors. Can some one give some idea what's wrong?
the UserInfo is a one-to-one relation to User.


Debug level Hibernate log excerpt:
21:33:37,765 DEBUG SQL:226 - insert into USER (EMAIL, password, type, status, subscription, nickname, lastname, firstname, point, vipPoint, authorPoint, authorVipPoint, USER_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, null)

21:33:37,781 DEBUG SQL:226 - call identity()

21:33:37,796 DEBUG SQL:226 - insert into USER_INFO (pendingEmail, address1, address2, city, state, zip, country, secretQuestion, secretAnswer, gender, birthday, birthmonth, birthyear, profession, education, income, phone, mobile, qq, msn, yahoo, searchable, updatedDate, createdDate, USER_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

21:33:37,796 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: null

21:33:37,796 ERROR JDBCExceptionReporter:46 - failed batch

21:33:37,796 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: null

21:33:37,796 ERROR JDBCExceptionReporter:46 - failed batch

21:33:37,828 ERROR JDBCExceptionReporter:38 - Could not execute JDBC batch update

java.sql.BatchUpdateException: failed batch

at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source)

at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source)

at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)

at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:126)

at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2421)

at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2371)

at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2240)

at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)

at com.sanduo.book.action.RegisterAction.execute(RegisterAction.java:41)

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:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at com.sanduo.framework.auth.Authentication13Filter.doFilter(Authentication13Filter.java:107)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)

at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)

at java.lang.Thread.run(Thread.java:534)

21:33:37,843 ERROR SessionImpl:2379 - Could not synchronize database state with session

net.sf.hibernate.JDBCException: Could not execute JDBC batch update

at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:133)

at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2421)

at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2371)

at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2240)

at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)

at com.sanduo.book.action.RegisterAction.execute(RegisterAction.java:41)

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:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at com.sanduo.framework.auth.Authentication13Filter.doFilter(Authentication13Filter.java:107)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)

at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)

at java.lang.Thread.run(Thread.java:534)

Caused by: java.sql.BatchUpdateException: failed batch

at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source)

at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source)

at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)

at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:126)

... 42 more

21:33:37,875 WARN RequestProcessor:538 - Unhandled Exception thrown: class net.sf.hibernate.JDBCException


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 29, 2004 12:48 am 
Newbie

Joined: Tue Sep 28, 2004 12:56 pm
Posts: 9
<b>Here is the code</b>
UserInfo userInfo = new UserInfo();
User user = new User();
BeanUtils.copyProperties(user, form);
BeanUtils.copyProperties(userInfo, form);
Date today = new Date();
userInfo.setUpdatedDate(today);
userInfo.setCreatedDate(today);
userInfo.setUser(user);
Session session = Authentication13Filter.getSession();
Transaction tx = session.beginTransaction();
session.save(userInfo);
System.out.println("SAVE USER");
tx.commit();
session.close();


Top
 Profile  
 
 Post subject: HSQL : Could not execute JDBC batch update
PostPosted: Thu May 05, 2005 5:10 am 
Regular
Regular

Joined: Tue Sep 28, 2004 5:18 pm
Posts: 55
Location: Switzerland
I get a similar exception when trying to recursively delete objects in a tree of objects with a unidirectional many-to-one relation from child to parent.

This exception occurs only with HSQL. The same code and mapping is being used in production with a different database without any error.

I have not yet discovered a workaround.

show_sql output
Code:
Hibernate: select this_.book_metadata_key as book1_0_, this_.book_metadata_id as book2_11_0_, this_.title as title11_0_, this_.copyright_holder as copyright4_11_0_, this_.copyright_year as copyright5_11_0_, this_.copyright_address as copyright6_11_0_, this_.copyright_email as copyright7_11_0_, this_.copyright_url as copyright8_11_0_, this_.credits as credits11_0_, this_.credit_text as credit10_11_0_, this_.description as descrip11_11_0_, this_.isbn as isbn11_0_, this_.language_info_key as language13_11_0_, this_.published_date as published14_11_0_, this_.series as series11_0_, this_.software_version as software16_11_0_, this_.collection as collection11_0_, this_.paper_type as paper18_11_0_, this_.subtitle as subtitle11_0_, this_.license as license11_0_, this_.parent_book_metadata_key as parent21_11_0_, this_.prime_book_metadata_key as prime22_11_0_ from book_metadata this_ where this_.parent_book_metadata_key=?
Hibernate: select this_.book_key as book1_0_, this_.max_generations as max2_15_0_, this_.usage_permission_id as usage3_15_0_, this_.scale_printing as scale4_15_0_, this_.restrict_setup as restrict5_15_0_, this_.default_font as default6_15_0_, this_.book_metadata_key as book7_15_0_, this_.owner as owner15_0_ from book this_ where this_.book_metadata_key=?
Hibernate: delete from book_metadata where book_metadata_key=?


exception
Code:
(util.JDBCExceptionReporter          71  ) SQL Error: 0, SQLState: null
(util.JDBCExceptionReporter          72  ) failed batch
(def.AbstractFlushingEventListener   277 ) Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
   at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
   at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:179)
   at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:72)
   at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:67)
   at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:148)
   at org.hibernate.persister.entity.BasicEntityPersister.delete(BasicEntityPersister.java:2039)
   at org.hibernate.persister.entity.BasicEntityPersister.delete(BasicEntityPersister.java:2203)
   at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:59)
   at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:678)
   at sb.util.hibernate.SyncSession.flush(SyncSession.java:78)
   at sb.biz.DaoManager.delete(DaoManager.java:113)
   at sb.biz.MetadataCleaner.pruneNode(MetadataCleaner.java:50)
   at sb.biz.MetadataCleaner.pruneShell(MetadataCleaner.java:34)
   at sb.biz.BookDeleter.delete(BookDeleter.java:36)
   at sb.data.dao.ThingyDaoTest.testDeleteAll(ThingyDaoTest.java:54)
   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 junit.framework.TestCase.runTest(TestCase.java:154)
   at junit.framework.TestCase.runBare(TestCase.java:127)
   at junit.framework.TestResult$1.protect(TestResult.java:106)
   at junit.framework.TestResult.runProtected(TestResult.java:124)
   at junit.framework.TestResult.run(TestResult.java:109)
   at junit.framework.TestCase.run(TestCase.java:118)
   at junit.framework.TestSuite.runTest(TestSuite.java:208)
   at junit.framework.TestSuite.run(TestSuite.java:203)
   at junit.textui.TestRunner.doRun(TestRunner.java:116)
   at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57)
   at junit.textui.TestRunner.start(TestRunner.java:172)
   at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
   at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97)
   at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
   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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Caused by: java.sql.BatchUpdateException: failed batch
   at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source)
   at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source)
   at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
   at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)
   at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:172)
   ... 41 more


mapping-excerpt
Code:
<class
        name="sb.biz.model.BookMetadata"
        table="book_metadata"
        dynamic-update="false"
        dynamic-insert="false"
        select-before-update="false"
        optimistic-lock="version"
    >
        <cache usage="read-write" />

        <id
            name="bookMetadataKey"
            column="book_metadata_key"
            type="java.lang.Integer"
        >
            <generator class="increment">
              <!-- 
                  To add non XDoclet generator parameters, create a file named
                  hibernate-generator-params-BookMetadata.xml
                  containing the additional parameters and place it in your merge dir.
              -->
            </generator>
        </id>

        [...]

        <many-to-one
            name="parentBookMetadata"
            class="sb.biz.model.BookMetadata"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            access="property"
        >
            <column
                name="parent_book_metadata_key"
            />
        </many-to-one>

        [...]
  </class>



code-excerpt
Code:
public static void pruneNode(DefaultMutableTreeNode node) {
        final BookMetadata bm = (BookMetadata) node.getUserObject();
        if (bm == null) {
            return;
        }

        final Book book = DaoManager.getBookDao().selectByMetadata(bm);
        if (node.getChildCount() == 0 && book == null) {
            DaoManager.delete(bm);
            final DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node.getParent();

            if (parentNode != null) {
                parentNode.remove(node);
                pruneNode(parentNode);
            }
        }
    }


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 20, 2005 2:36 pm 
Newbie

Joined: Thu Oct 21, 2004 7:02 am
Posts: 14
Hi,
Have you managed to solve this?

I'm running into the same kind of problem:
http://forum.hibernate.org/viewtopic.ph ... qldb+batch

--
Kristian


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 20, 2005 2:40 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
kristiann wrote:
Hi,
Have you managed to solve this?

I'm running into the same kind of problem:
http://forum.hibernate.org/viewtopic.ph ... qldb+batch

--
Kristian



This isn't an answer but it might help you find one. set the configuration property hibernate.jdbc.batch_size=0 and all of your database calls should execute one at a time and give you better error messages.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 20, 2005 3:26 pm 
Newbie

Joined: Thu Oct 21, 2004 7:02 am
Posts: 14
Hi,
Thanks, that gave me a better error message, but I still don't understand why it doesn't work.

Here is my mapping:
Code:
<hibernate-mapping>

  <class name="packagename.FormElementTemplateValidation">

    <composite-id>
      <key-many-to-one name="formElementTemplate" class="packagename.FormElementTemplate"/>
      <key-property name="validator"/>
    </composite-id>

    <map name="context" cascade="all-delete-orphan">
      <key>
        <column name="formElementTemplate"/>
        <column name="validator" length="150"/>
      </key>

      <map-key type="string" length="50"/>
      <element type="string"/>
    </map>

  </class>

</hibernate-mapping>


When I try to add one of these, with a "context" I get this one:

Code:
2005-05-21 02:15:06,566 WARN net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/home/kristian/.m2/repository/ehcache/ehcache/0.7/ehcache-0.7.jar!/ehcache-failsafe.xml
Hibernate: /*insert packagename.DataElement*/insert into DataElement (name, description, active, type, id) values (?, ?, ?, ?, null)
Hibernate: call identity()
Hibernate: /*load packagename.DataElement*/select dataelemen0_.id as id0_, dataelemen0_.name as name2_0_, dataelemen0_.description as descript3_2_0_, dataelemen0_.active as active2_0_, dataelemen0_.type as type2_0_ from DataElement dataelemen0_ where dataelemen0_.id=?
Hibernate: /*insert packagename.DataElementValidation*/insert into DataElementValidation (dataElement, validator) values (?, ?)
Hibernate: /*insert collection row packagename.DataElementValidation.context*/insert into context (dataElement, validator, idx, elt) values (?, ?, ?, ?)
2005-05-21 02:15:08,078 WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: -10, SQLState: 23000
2005-05-21 02:15:08,082 ERROR org.hibernate.util.JDBCExceptionReporter - Try to insert null into a non-nullable column: column: FORMELEMENTTEMPLATE table: CONTEXT in statement [/*insert collection row packagename.DataElementValidation.context*/insert into context (dataElement, validator, idx, elt) values (?, ?, ?, ?)]
2005-05-21 02:15:08,104 ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not insert collection: [packagename.DataElementValidation.context#component[dataElement,validator]{validator=packagename.MinMaxValidator, dataElement=packagename.DataElement#1}]
   at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
   at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:899)
   at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:23)
   at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:678)
   at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:309)
   at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
   at packagename.HibernateTransactionManager.leave(HibernateTransactionManager.java:188)
   at packagename.TransactionInterceptor.invoke(TransactionInterceptor.java:64)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
   at $Proxy2.addDataElementValidation(Unknown Source)
   at packagename.HibernateValidationStoreTest.testBasicDataElementValidation(HibernateValidationStoreTest.java:83)
   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 junit.framework.TestCase.runTest(TestCase.java:154)
   at junit.framework.TestCase.runBare(TestCase.java:127)
   at junit.framework.TestResult$1.protect(TestResult.java:106)
   at junit.framework.TestResult.runProtected(TestResult.java:124)
   at junit.framework.TestResult.run(TestResult.java:109)
   at junit.framework.TestCase.run(TestCase.java:118)
   at junit.framework.TestSuite.runTest(TestSuite.java:208)
   at junit.framework.TestSuite.run(TestSuite.java:203)
   at junit.textui.TestRunner.doRun(TestRunner.java:116)
   at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57)
   at junit.textui.TestRunner.start(TestRunner.java:172)
   at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
   at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97)
   at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
   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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Caused by: java.sql.SQLException: Try to insert null into a non-nullable column: column: FORMELEMENTTEMPLATE table: CONTEXT in statement [/*insert collection row packagename.DataElementValidation.context*/insert into context (dataElement, validator, idx, elt) values (?, ?, ?, ?)]
   at org.hsqldb.jdbc.jdbcUtil.throwError(Unknown Source)
   at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
   at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
   at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:880)
   ... 38 more


Seems like it tries to set the FK columns of the context table to null. But I never do anything else than create the object and use session.save(..). This doesn't happen in MySQL, only in hsqldb. Any idea?

--
Thanks,
Kristian


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.