Sergey Didenko
2009-01-25 10:19:40 UTC
Moving our discussion to the mail list...
Hi,
I'm considering using Prevayler for a web application. Could you answer a question about Prevayler and thread-safety?
--------------------------------------------------------------
Prevayler guarantees that all the writes ( through its transactions) are synchronized. But what about reads?
Is it right that dirty reads are possible if no explicit synchronizing is used (in user code)?
// get the 3rd account
Accont account = (Bank)prevayler.prevalentSystem().getAccounts().get(2);
?
If so what synchronizing strategies are good for a user code?
(Consider a business object A contains a collection of business objects Bs),
using a synchronized collection (of Bs inside of A), for example from java.util.concurrent package?
synchronize collection reads outside transactions with the collection writes inside transactions, for example using "synchronized( collection )" code around reads and writes?
--------------------------------------------------------------
Cheers, Sergey
Hi Sergey,
Take a look at the javadoc for Prevayler.execute(Query)
See you, Klaus.
I'm considering using Prevayler for a web application. Could you answer a question about Prevayler and thread-safety?
--------------------------------------------------------------
Prevayler guarantees that all the writes ( through its transactions) are synchronized. But what about reads?
Is it right that dirty reads are possible if no explicit synchronizing is used (in user code)?
// get the 3rd account
Accont account = (Bank)prevayler.prevalentSystem().getAccounts().get(2);
?
If so what synchronizing strategies are good for a user code?
(Consider a business object A contains a collection of business objects Bs),
using a synchronized collection (of Bs inside of A), for example from java.util.concurrent package?
synchronize collection reads outside transactions with the collection writes inside transactions, for example using "synchronized( collection )" code around reads and writes?
--------------------------------------------------------------
Cheers, Sergey
Hi Sergey,
Take a look at the javadoc for Prevayler.execute(Query)
See you, Klaus.