> hi all,
>
> A newbie issue has been bugging me.
>
> I created a simple one to many relationship and have been trying to persist
> it to the database using appfuse archetyped project. Troop and Soldier
> classes are pretty straight forward with the following annotation to mark
> the association (directly copied from the hibernate annotation test cases).
>
> However while running the test cases, Spring's HibernateTransactionManager
> is rolling back the transaction.
>
> [timeflies] DEBUG [main] TroopDaoTest.startNewTransaction(392) | Began
> transaction (1): transaction manager
> [org.springframework.orm.hibernate3.HibernateTransactionManager@987197];
> rollback [true].
> [timeflies] DEBUG [main] TransactionSynchronizationManager.getResource(146)
> | Retrieved value [org.springframework.orm.hibernate3.SessionHolder@dc9766]
> for key [org.hibernate.impl.SessionFactoryImpl@bc5596] bound to thread
> [main]
> [timeflies] DEBUG [main] TransactionSynchronizationManager.getResource(146)
> | Retrieved value [org.springframework.orm.hibernate3.SessionHolder@dc9766]
> for key [org.hibernate.impl.SessionFactoryImpl@bc5596] bound to thread
> [main]
> [timeflies] DEBUG [main] HibernateTemplate.doExecute(410) | Found
> thread-bound Session for HibernateTemplate
> [timeflies] DEBUG [main] SQL.log(401) | insert into Troop (id, name) values
> (null, ?)
> [timeflies] DEBUG [main] SQL.log(401) | call identity()
> [timeflies] DEBUG [main] SQL.log(401) | insert into Soldier (id, name,
> troop_fk) values (null, ?, ?)
> [timeflies] DEBUG [main] SQL.log(401) | call identity()
> [timeflies] DEBUG [main] SQL.log(401) | insert into Soldier (id, name,
> troop_fk) values (null, ?, ?)
> [timeflies] DEBUG [main] SQL.log(401) | call identity()
> [timeflies] DEBUG [main] HibernateTemplate.doExecute(435) | Not closing
> pre-bound Hibernate Session after HibernateTemplate
> [timeflies] DEBUG [main]
> HibernateTransactionManager.triggerBeforeCompletion(893) | Triggering
> beforeCompletion synchronization
> [timeflies] DEBUG [main] HibernateTransactionManager.processRollback(798) |
> Initiating transaction rollback
> [timeflies] DEBUG [main] HibernateTransactionManager.doRollback(621) |
> Rolling back Hibernate transaction on Session
> [org.hibernate.impl.SessionImpl@19a8416]
> [timeflies] DEBUG [main]
> HibernateTransactionManager.triggerAfterCompletion(922) | Triggering
> afterCompletion synchronization
> [timeflies] DEBUG [main]
> TransactionSynchronizationManager.clearSynchronization(282) | Clearing
> transaction synchronization
> [timeflies] DEBUG [main]
> TransactionSynchronizationManager.unbindResource(199) | Removed value
> [org.springframework.orm.hibernate3.SessionHolder@dc9766] for key
> [org.hibernate.impl.SessionFactoryImpl@bc5596] from thread [main]
>
> The offending lines have been highlighted. I am not so sure why. The simple
> PersonDao test works all fine. Something fundamental is missing my eyes.
> Your insights would be helpful
>
> Thanks
> anand
>
>
> --
> Phone +91 98809 37073
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
[hidden email]
> For additional commands, e-mail:
[hidden email]
>