This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Commit a transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Commit a transaction" Watch "Commit a transaction" New topic

Commit a transaction

dina raj

Joined: Dec 06, 2005
Posts: 17
My application contains a table, Cust which has a child CUST_IDENTIFIER.

The problem arises when we try to insert a customer who has data that creates a constriant violation in the CUST_IDENTIFIER but no issues in the cust table. Will modifying the hbm.xml file, solve this issue. I need to solve the issue so that when i save the CUST table it tells me that it cannot insert because the child table has a constraint violation (or an exception is thrown) . Instead now data is inserted into the child table but an exception is thrown when it tries the CUST_IDENTIFIER table. I need to solve this by modifying the hibernate files .

[ Edited to use code tags - Paul Sturrock ]
[ November 17, 2006: Message edited by: Paul Sturrock ]
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17271

Yes, try to put


on the many side instead of the one side, and see what happens.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Have you checked out Aspose?
subject: Commit a transaction
It's not a secret anymore!