This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi Matt, I have not implemented any sort of thread pool for making my server multithreaded. I am relying on RMI to create a new thread for every request and optimizing the use of threads. Moreover I have only once instance of data class for every database. This instance is bound to the RMIRegistry, so there is only one instance of db.db active at one time. Hope it helps. Any suggetions are welcome, Thanks, Abhinav
Joined: Feb 24, 2002
Actually, what I was considering doing was to make my RMI network layer infront of my database class. Then, I was either going to be single threaded into my db file, or I was going to build a threading pool off my rmi server to access my database. I am believing that this is overkill, and I think your solution is much simpler and more elegant, but I worry about locking/unlocking with each member threading into the data class. directly with RMI. I can see coruption happening if one client add data and another calls delete data. I think that there should be some interim class between the db.db file and the rmi server. Thoughts? -Matt [ May 03, 2002: Message edited by: Matt Ghiold ]
Joined: May 02, 2002
Hi, You are right in your concern for multiple threads corrupting the data by invoking different methods of a sigle data instance. Even a harmless operation like criteriaFind can cause a genuine modify operation to corrupt the database. I had some discussion with other members of this group on this issue. See the posting with the topic "thread safety and synchronized". It was posted recently and I think you would find it useful. Thanks, Any suggetions are welcome