Hello,

assume I got a webapp where documents are assigned to users. The user must
be an enabled user. I want to assign a document to user A who is enabled
when the service layer is processed:

if (document.getUser.getEnabled())
        dao.save(document);

But it the very short time between the check in the service layer and the
real table update in the database layer, some other guy disables user A. The
update of the document should fail!

So do I have to implement the check in database layer? What do you suggest?
Can I lock the User instance in short time between
document.getUser().getEnabled() and SQL statement to update the document?

Thanks
René

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to