-->
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.  [ 4 posts ] 
Author Message
 Post subject: JUnit Test Cases Fail for PostgreSQL
PostPosted: Fri Nov 12, 2004 8:29 pm 
Newbie

Joined: Mon Sep 06, 2004 1:39 pm
Posts: 18
Location: Utah, USA
I have purchased HIA and am working through the sample application caveatemptor. I have modified the hibenate.cfg.xml file that came with caveatemptor to use PostgreSQL (version below). I am using Eclipse 3 as my development environment. When I run the Test Cases, AllTests.java the JUnit tab comes up and tells me that testPlaceBid, testCompositeQuery and testDeletionFromCategory failed, while the others passed. Are there some features not available in postgresql or have I configured something improperly? Thanks for any pointers...

Hibernate version: latest

Mapping documents: caveatemptor

Full stack trace of any exception that occurs:
Running test...
16:40:29,419 WARN JDBCExceptionReporter: SQL Error: 0, SQLState: XX000
16:40:29,419 ERROR JDBCExceptionReporter: ERROR: relation 43416 deleted while still in use

16:40:29,419 WARN JDBCExceptionReporter: SQL Error: 0, SQLState: XX000
16:40:29,419 ERROR JDBCExceptionReporter: ERROR: relation 43416 deleted while still in use

16:40:29,419 ERROR JDBCExceptionReporter: Could not save object
org.postgresql.util.PSQLException: ERROR: relation 43416 deleted while still in use

at org.postgresql.util.PSQLException.parseServerError(PSQLException.java:139)
at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:152)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:100)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)
at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:517)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:50)
at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:233)
at net.sf.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:69)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:765)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1388)
at org.hibernate.auction.dao.CategoryDAO.makePersistent(CategoryDAO.java:81)
at org.hibernate.auction.test.TestCaseWithData.initData(TestCaseWithData.java:51)
at org.hibernate.auction.test.CategoryItemTest.testCompositeQuery(CategoryItemTest.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at org.hibernate.auction.test.TestCase.runTest(TestCase.java:17)
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.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)


Name and version of the database you are using: PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

JUNIT Test cases FAIL


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 13, 2004 6:07 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
This seems to be a weird problem with the order of test execution, I can see that every second test fails on PostgreSQL. I remember that I've tried this (there is even a postgres configuration block left in hibernate.cfg.xml) and it worked fine. I'll have a look.

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


Top
 Profile  
 
 Post subject: test another database
PostPosted: Tue Nov 23, 2004 12:53 am 
Newbie

Joined: Mon Sep 06, 2004 1:39 pm
Posts: 18
Location: Utah, USA
I have freshly installed another PostgreSQL server on a different machine and found the same problem to be occurring. I am interested in using PostgreSQL for my application, but I am concerned that these tests fail.

Is this a problem between Hibernate/PostgreSQL or just Caveatemptor/PostgreSQL? Where would I look to correct the problem?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 23, 2004 4:34 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
That is very highly likely a trivial problem in CaveatEmptor.

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


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