-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problem with Hibernate 3 test framework
PostPosted: Wed Mar 23, 2005 5:04 am 
Newbie

Joined: Wed Mar 23, 2005 4:52 am
Posts: 1
HI

I have a problem with the test run (build junitreport) of the Hibernate - Relational Persistence for Idiomatic Java (version 3.0 rc 1, 28 February 2005).

With using MySQL or HSQL databases it works correctly. But with a DB2 connection the test hanging and the run must be terminated.
I tried with the new or old query parser with the same effect.

What problems can be?

Thanks a lot
Funimax


We using DB2 Version :
============================================================
About DB2 Administration Tools Environment
============================================================
DB2 administration tools level:
Product identifier SQL08013
Level identifier 02040106
Level DB2 v8.1.3.132
Build level s030728
PTF WR21324
============================================================
Java development kit (JDK):
Level IBM Corporation 1.3.1
============================================================
Following the output of console:
C:\Work_Infrast\hibernate-3.0>build junitreport
C:\Work_Infrast\hibernate-3.0>set JDBC_DRIVER=lib/db2java.zip
C:\Work_Infrast\hibernate-3.0>C:\Programme\j2sdk1.4.2_06\bin\java -cp "lib/ant-launcher-1.6.2.jar" org.apache.tools.ant.launch.Launcher -lib lib -Ddriver.jar=lib/db2java.zip junitreport
Buildfile: build.xml
[taskdef] Could not load definitions from resource checkstyletask.properties. It could not be found.
[taskdef] Could not load definitions from resource clovertasks. It could not be found.

splash:

cleantestdb:

init:
[echo] Build Hibernate-3.0 (2005-03-23 08:46:27)
[echo] JDK version: 1.4

init.antlr:

antlr:

compile:

compiletest:

instrument:
[instrument] C:\Work_Infrast\hibernate-3.0\build\testclasses\org\hibernate\test\lazyonetoone\Employee.class already instrumented.
[instrument] C:\Work_Infrast\hibernate-3.0\build\testclasses\org\hibernate\test\instrument\Folder.class already instrumented.
[instrument] C:\Work_Infrast\hibernate-3.0\build\testclasses\org\hibernate\test\instrument\Owner.class already instrumented.
[instrument] C:\Work_Infrast\hibernate-3.0\build\testclasses\org\hibernate\test\instrument\Document.class already instrumented.
[instrument] C:\Work_Infrast\hibernate-3.0\build\testclasses\org\hibernate\test\lazyonetoone\Person.class already instrumented.
[instrument] C:\Work_Infrast\hibernate-3.0\build\testclasses\org\hibernate\test\lazyonetoone\Employment.class already instrumented.

junit:
[junit] Running org.hibernate.test.unionsubclass.UnionSubclassTest
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.521 sec
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.01 sec
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 21.421 sec
[junit] TEST org.hibernate.test.batch.BatchTest FAILED
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.733 sec
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 1.953 sec
[junit] TEST org.hibernate.test.bidi.AuctionTest FAILED
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.001 sec
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 3.055 sec
[junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 3.685 sec
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.963 sec
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.993 sec
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 5.077 sec
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 2.994 sec
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 2.214 sec
[junit] Returning DOM : <company id="123">description...<name>JBoss</name><account num="456"/></company>
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0.48 sec
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 3.205 sec
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 3.095 sec
[junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 2.383 sec
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 2.664 sec
[junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0 sec
[junit] TEST org.hibernate.test.extendshbm.ExtendsTest FAILED


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 05, 2005 12:16 pm 
Newbie

Joined: Tue Dec 16, 2003 12:02 pm
Posts: 14
Location: Geneva, Switzerland
getting the same error on postgres.
java 1.5.0_05
hibernate 3.0.5
postgresql-8.1-404.jdbc3

It looks to me like the problem is with the JDBC driver. The junitreport hangs on org.hibernate.test.batch.BatchTest , but it you exclude the test on that class, the error returned in the testout looks like:

Quote:
Testsuite: org.hibernate.test.bidi.AuctionTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.986 sec

Testcase: testLazy took 0.947 sec
Caused an ERROR
Could not execute JDBC batch update
org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:59)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:181)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:74)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:69)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:150)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java
:1839)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java
:2200)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:46)
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:136)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlus
hingEventListener.java:274)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.
java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:324)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
at org.hibernate.test.bidi.AuctionTest.testLazy(AuctionTest.java:38)
at org.hibernate.test.TestCase.runTest(TestCase.java:129)
Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into TAuction (description, end,
id) values (an auction for something, 2005-12-05 17:03:56.004000 +0100, 2) was aborted. Call
getNextException to see the cause.
at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJ
dbc2Statement.java:2478)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1298)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:347)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java
:2540)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:174)
... 31 more



Searching the hibernate users forum for batch update seems to indicate this error happens also with other drivers.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 05, 2005 1:42 pm 
Newbie

Joined: Tue Dec 16, 2003 12:02 pm
Posts: 14
Location: Geneva, Switzerland
batch update error no longer appears when using hibernate 3.1rc3 but junitreport takes a very long time unless the number of iterations in test.batch.BatchTest.testBatchInsertUpdate() is significantly reduced.

Code:
public void testBatchInsertUpdate() {
      
      //remember to set hibernate.jdbc.batch_size=20
      
      long start = System.currentTimeMillis();
      
      final boolean flushInBatches = true;
      final int N = 5000; // 19 secs 
// This takes several minutes:
      //final int N = 50000; //26 secs with batch flush, 26 without
...


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