aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Seeking design pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Seeking design pattern" Watch "Seeking design pattern" New topic
Author

Seeking design pattern

Dikran Seropian
Greenhorn

Joined: Sep 23, 2002
Posts: 8
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,


Dikran
Tina Coleman
Ranch Hand

Joined: Dec 12, 2001
Posts: 150
Can you do anything with transactions, either EJB container controlled or otherwise?
Dikran Seropian
Greenhorn

Joined: Sep 23, 2002
Posts: 8
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,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Seeking design pattern