File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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,
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Seeking design pattern
 
Similar Threads
comment on public method
To bean or not to bean
Passed Part 2/3
System.arraycopy() or clone().
FBN: Which classes in which package?