Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB and other Java EE Technologies and the fly likes Not able to delete a record Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Not able to delete a record " Watch "Not able to delete a record " New topic
Author

Not able to delete a record

Diya charu
Greenhorn

Joined: Nov 29, 2006
Posts: 8
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

Joined: Jun 19, 2006
Posts: 81
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

Joined: Nov 29, 2006
Posts: 8
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

Joined: Jun 19, 2006
Posts: 81
The url provides pointers regarding cascade delete for EJB relationships.

Refer the url. Refer the dropPerson method implementation. I hope your implementation is similiar.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Not able to delete a record
 
Similar Threads
NX: Primary Key and Immutable Key
update/delete/unlock/isLocked and RecNotFoundEx
Locking strategy URLyBird 1.1.1 with ReentrantLock
nx: All of URLy Bird 1.1.3 read/write lock(2)
question on the Data class