Hi, My probl. regards a design sol. for a j2ee system. The main issue is that the database is concurently accesible by 2 applications (including my j2ee client). Moreover, the other app has the freedom to make changes to the data (including changing PK) whenever it wishes. I must not make any change in the db model. I am seeking some pattern to control reads/updates without any of the apps using the db to get locked on some row or the final client loosing too much work because the data he worked on has been changed in the meanwhile. What would you suggest? Thanks,
Joined: Dec 12, 2001
Can you do anything with transactions, either EJB container controlled or otherwise?
Joined: Sep 23, 2002
Hi Tina, Yes, this db seems to be jdbc30 compliant. I think I have only 2 solutions: for non critical actions to use an optimistic lock, so my client will lose his work in case the underlying data has changed before he commited, and for critical actions use pesimistic lock, so anybody else will have to delay their updates until my client gets finished. The only thing I can do more about it would be to set some time limit for the transaction. However, all of it needs to be hardcoded, no CMP, no JDO, no caching... cheers,