• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need urgent help with Transaction

 
Pappu Kumar
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Weblogic Server 6.1 sp4.

I have a entity (person) which has constraints (address,office).

When i delete Person.....i make a call to deleteAddress(personId) and deleteOffice(personId) , recursively (one person can have many addressed and multiple offices).

the basic logic inside the deleteXXX methods is as follows :
----------------------
1.) If being called from a TX context...use that TX else start ur new one.
New TX are needed coz its possible to delete just the address or the office .

2.) do the work

3.) if ur own TX then commit...if not then return.


The problem is....that when i delete a person , it says it succesfully deleted address and office....but when i run the deletePerson SQL....it gives me the SQLException for the contraints.

Can someone help me ??
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the EJB forum...
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using EJB 2.0? If so then why not just use cascade-delete if you are using CMP. Or are you using BMP instead?

Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!