File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Does not save the deleted record Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Does not save the deleted record" Watch "Does not save the deleted record" New topic

Does not save the deleted record

savitha rao

Joined: Jun 05, 2001
Posts: 6
I am using weblogic 5.1.0 with service pack 9. I am using entity beans to add a record in the database. It is adding without any problem. But when I try to manually delete a record in the table while the weblogic server is running and from my front end i again try to add the same record it does not allow me to do so. It does not throw any expection. Everytime I try to add a new record I do a checking for its existence by find by primary key.
This is true when i delete the record manually from the database when the weblogic server is running. If i shutdown the server and redo it once again then it accepts the data. Can you just tell me how to overcome this situation.
Thank you in advance
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

A DBMS should not be expected to do a general notification of all applications when a record is deleted, whether they're simple C programs or advanced EJB app servers. That's just not part of what they're expected to do. Normally a DBMS relies on record locking. WebLogic isn't locking EJB-correspondent records, so an external delete simply confuses it.
I can't complain about that, since record locking is extra overhead, and as long as your records are updated and deleted within WebLogic, the EJB transaction management services will ensure data integrity at the WebLogic level with a lot less fuss.
There are two possible solutions.
1. Replace your present external deletion actions with EJB client applications so that everything is managed in one place. I recommend doing this if possible.
2. Check the WebLogic docs for info on how to ensure that held/cached EJB data can be locked against external actions.
BMP beans are more likely to cause trouble than CMP beans, since that pretty much puts the responsibility of locking on your code.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Does not save the deleted record
It's not a secret anymore!