[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3163?page=c...
]
Ovidiu Feodorov commented on HHH-3163:
--------------------------------------
To build, deploy and run the test case:
1. Set JBOSS_HOME environment variable to point towards the JBoss instance that will be
used
for testing. The current test assumes that "default" configuration will be
used. Also, the
current test assumes that $JBOSS_HOME/server/default/lib/hibernate3.jar is a Hibernate
3.2.1.GA
jar.
2. Make sure an Oracle datasource is deployed as /OracleDS within the JBoss instance used
for
testing.
3. Start the JBoss instance.
4. ant deploy
The ant script will deploy a HHH-3163.sar service archive, which contains a TestService
MBean.
During its initialization sequence, the service will load test data (loadTestData()), and
then will
attempt to delete test data under special circumstances.
The test will fail if:
- The delete appears to work (a non-zero deleted records count is returned by
query.executeUpdate()).
- Transaction commit succeeds.
- The number of records in the table is the same as before the delete attempt.
This is the typical output of a failed test:
...
01:01:27,328 INFO [STDOUT] RECORDS BEFORE DELETE: 1
01:01:27,468 INFO [STDOUT] Hibernate: insert into HT_Record select record0_.id as id from
( select content, null as extraContent, id, 1 as clazz_ from Record union all select
content, extraContent, id, 2 as clazz_ from LargeRecord ) record0_ where id between ? and
?
01:01:27,546 INFO [STDOUT] Hibernate: delete from Record where (id) IN (select id from
HT_Record)
01:01:27,578 INFO [STDOUT] Hibernate: delete from Record where (id) IN (select id from
HT_Record)
01:01:27,593 INFO [STDOUT] Hibernate: delete from LargeRecord where (id) IN (select id
from HT_Record)
01:01:27,625 INFO [STDOUT] Hibernate: delete from HT_Record
01:01:27,640 INFO [STDOUT] SUCCESSFULLY DELETED 1 RECORDS, THE TABLE APPARENTLY HAS 0
RECORDS LEFT
01:01:27,656 INFO [STDOUT] Hibernate: select record0_.id as col_0_0_ from ( select
content, null as extraContent, id, 1 as clazz_ from Record union all select content,
extraContent, id, 2 as clazz_ from LargeRecord ) record0_
01:01:27,718 INFO [STDOUT] THE TABLE ACTUALLY CONTAINS 1 RECORDS
01:01:27,718 WARN [ServiceController] Problem starting service test:service=TestService
java.lang.Exception: TEST FAILED: expected 0 records in table, but found 1
at com.novaordis.HHH3163.TestService.deleteTestData(TestService.java:199)
at com.novaordis.HHH3163.TestService.start(TestService.java:46)
...
This is the expected outcome of a successful test:
01:03:50,328 WARN [ServiceController] Problem starting service test:service=TestService
org.hibernate.exception.ConstraintViolationException: error performing bulk delete
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
...
Caused by: java.sql.SQLException: ORA-02292: integrity constraint (OFEODORO.ITEM_RECORD)
violated - child record found
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
Delete query reports rows deleted in the database, commit succeeds,
but rows are not actually deleted from the database
-----------------------------------------------------------------------------------------------------------------------
Key: HHH-3163
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3163
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.1
Reporter: Ovidiu Feodorov
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira