"javax.ejb.EJBException: Error performing store" in test
org.jboss.test.hibernate.test.HibernateIntgUnitTestCase
----------------------------------------------------------------------------------------------------------------
Key: JBAS-3534
URL:
http://jira.jboss.com/jira/browse/JBAS-3534
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Test Suite
Affects Versions: JBossAS-5.0.0.Beta
Environment: win xp
Reporter: Jaroslaw Kijanowski
This test contains two methods ( testRedeployment() and testCurrentSession() ). The first
one creates an user with a handle "myHandle" and stores him in a database. The
second one creates a user too, with the same handle. This is the reason for the
EJBException. Deeper in the stacktrace there is an
"org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch
update" so it's is not an JBAS issue, right? If yes here's the fix for the
testsuite test, so it can run successfully:
In the testCurrentSession() method replace following lines of code:
***************
current:
user.setHandle("myHandle");
has to be:
user.setHandle("myHandle-testCurrentSession");
***************
current:
assertEquals( "Incorrect result size", 1, users.size() );
has to be:
assertEquals( "Incorrect result size", 2, users.size() );
// This is because we have now two users in the database, one created with the first
method, and a second one created inside this method
***************
current:
Long userId = ( ( User ) users.get( 0 ) ).getId();
assertEquals( "Saved used not returned", savedUserId, userId );
has to be:
Long userId = ( ( User ) users.get( 1 ) ).getId();
assertEquals( "Saved user not returned", savedUserId, userId );
// We need the second user from the database, to comapare his id with that one returned by
the method getId()
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira