Forums Register Login

Paasing a collection or a single object

+Pie Number of slices to send: Send
Hi everyone,

I read a lot of posts to resolve some questions about muy assigment (B&S) , but I have a question than I can't find: If the find method is called form the client side (this method returns a list of contractor's ids) and later this client read each record from the server, what mechanism can be used to prevent than others client modifies (update or delete) records while the reading is finished? (this can arises exceptions like RecordNotFoundException)

I have as a guide the Andrew's Book, and think than this is very good. In this book methods of interface returns directly a List with the DVD's, but the adapter class should return only recNos?

Thanks for your suggestions.
+Pie Number of slices to send: Send
Regarding your first question which about reading a record while it is being updated, this is called dirty reads. In the assignment, you are not required to solve the issue of dirty reads.In my case I did not solve this issue.
+Pie Number of slices to send: Send
Thanks for your answer Khaled, it's now clear for me, it means if a record is deleted while is trying to read it, simple ignores it and continue reading next record(Apply for 2-tier architecture). I though than a syncrhonization mechanism but i'm thinking in a 3-tier architecture model.
+Pie Number of slices to send: Send
Hi Guys,

I think that you just make a serious mistake if you just try to ignore the dirty reads issue, you can take a look at : http://faq.javaranch.com/view?ScjdFaq - the last point.
This can be solved in a elegant way in a three tier architecture, but they depends a little on your implementation. The key is that the middle layer controls the communication between the ui and the database, if it control it can decide if the value was changed(or delete) in the meantime an react properly.

Regards
M
+Pie Number of slices to send: Send
Hi Mihai,

After read more posts, i decide to implement a 3-tier architecture solution, I like more this approach. Looking last point in javaranch faq i think that it talk more about updating an contractor (this involves read and update) than do a search(involves search and then read finded records). I think have dirty reads is allowed, and fits in a 2-tier solution because search and reads are made in the (thick) client but another solution is make search and reads in the server side usign a thin client, and delegates responsability to server (as I like to implement ). I appreciate a lot your points of view, it helps me to resolve this question.
ice is for people that are not already cool. Chill with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 479 times.
Similar Threads
name and/or location search
Synchronization+RMI
lock/unlock & synchronized
Quick way of drawing LED style text?
NX: DuplicateKeyException for records without keys!? *blink*
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:07:20.