(similar applies to MDB)
Accessing resource managers and enterprise beans is disallowed in the session bean methods
for which the container does not have a meaningful transaction context and/or client security.
Originally posted by CP Cahill:
Wouldn't it be best to have a lock for the RandomAccessFile object and enforce a design rule that programmers must acquire this lock before using the object in any way?
Originally posted by Jonathan Wolter:
In many exam problems, we may assume only one "Server application" -- and if you choose, one thread - is accessing the database file. Do you have an implementation that suggests this thread safety issue is a problem? I must be missing something...
Originally posted by Musab Al-Rawi:
One solution that I can think of is opening a random access file in each method separately. That would solve closing the file and the unsynchronized length().
Originally posted by Alex Belisle Turcot:
I did not see this example, just a quick idea, could it be that he's using some WeakHashMap/WeakReferences ?