This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able to delete a record

 
Diya charu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

Using CMP ,I am trying to delete a record from database ,but While deleting a record from database (first i deleted foreign key in the table and then i deleted primary key)the following exception i am getting,

javax.transaction.TransactionRolledbackException: CORBA TRANSACTION_ROLLEDBACK 0x0 No; nested exception is:
org.omg.CORBA.TRANSACTION_ROLLEDBACK: javax.transaction.TransactionRolledbackException: ; nested exception is:
java.sql.SQLException: A parent row cannot be deleted because the relationship "NEWDESIGN.USER_ROLE_MAP.URM_FK" restricts the deletion.DSRA0010E: SQL State = 23504, Error Code
can you help me out.
 
Vinay Raj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What app. server are you using? Are you using EJBs for deletion? Check your settings on the EJB deployment descriptor for cascade-delete.
 
Diya charu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friend,

Thanks for your reply. My application server is websphere, yes i am using EJB for deletion,i am not able to delete the record.

With Regards
Charu
 
Vinay Raj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The url provides pointers regarding cascade delete for EJB relationships.

Refer the url. Refer the dropPerson method implementation. I hope your implementation is similiar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic