Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 2.0.4
-
Fix Version/s: None
-
Component/s: Persistence
-
Labels:
-
Environment:Windows XP, Oracle 10g
-
Testcase included:yes
Description
Given the following domain classes:
Author.groovy
String name static hasMany = [books:Book]
Book.groovy
String name static belongsTo = [author:Author] static hasMany = [pages:Page]
Page.groovy
Integer pageNumber static belongsTo = [book:Book]
The following integration test works against Oracle 10g, MySQL, and H2:
AuthorIntegrationTests.groovy
void test2DeepCascadeLevel1(){
Author a = new Author(name:"test")
Book b = new Book(name:"test")
a.addToBooks(b)
Page p = new Page(pageNumber:1)
b.addToPages(p)
a.save(failOnError:true)
assert Book.list().size() == 1
}
The following integration test works against MySQL and H2 but does not work against Oracle 10g:
AuthorIntegrationTests.groovy
void test2DeepCascadeLevel2(){
Author a = new Author(name:"test")
Book b = new Book(name:"test")
a.addToBooks(b)
Page p = new Page(pageNumber:1)
b.addToPages(p)
a.save(failOnError:true)
assert Page.list().size() == 1
}
I receive the following error message:
junit.framework.AssertionFailedError: Assertion failed:
assert Page.list().size() == 1
| | |
[] 0 false
at AuthorIntegrationTests.test3DeepCascadeLevel3(AuthorIntegrationTests.groovy:43)
And the following SQL output:
Hibernate: select hibernate_sequence.nextval from dual Hibernate: insert into author (version, name, id) values (?, ?, ?) Hibernate: select hibernate_sequence.nextval from dual Hibernate: insert into book (version, author_id, name, id) values (?, ?, ?, ?) Hibernate: select this_.id as id0_0_, this_.version as version0_0_, this_.book_id as book3_0_0_, this_.page_number as page4_0_0_ from page this_
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
duplicates
GRAILS-9170