File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes BEA/Weblogic and the fly likes question about weblogic batch statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "question about weblogic batch statement" Watch "question about weblogic batch statement" New topic

question about weblogic batch statement

smectite wo

Joined: Feb 05, 2007
Posts: 4
I ran into a problem using ejb2.0 entity bean and weblogic 8.1.

I want to manupilate one to many relationship in one single transaction. For example, I have a customer vo representing a customer entity bean, and also inside the customer vo, i have a list of account vos representing the account entities that customer have. When a user work on the customer vo, he can add, update, delete account vos. Once he is done, he submits the customer vo to the back end. To maintain his accounts and also avoid too much coding, I use a simple mechanism to update the account. First, I delete all accounts in the db, then I add new accounts based on the account list in the customer vo. The db table has the unique constraint for customer id and account id. My problem is that each time I run the code to update the relationship, I get "unique constraint violation".
It seems that weblogic batches the statements and somehow it changes the order for optimization. This is my guess, can someone confirm for me.
Besides, I know if I remove the unique constraint or do the remove and add in two transactions, it will be ok, but that is really not what i want
jQuery in Action, 2nd edition
subject: question about weblogic batch statement