aspose file tools
The moose likes Threads and Synchronization and the fly likes Getting single-threaded access to a Database Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Getting single-threaded access to a Database" Watch "Getting single-threaded access to a Database" New topic
Author

Getting single-threaded access to a Database

Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
I am writing an application where I need to assure that all updates to a Microsoft Access DB are single-threaded, using a "Singleton" (design pattern) Database broker object. All objects wanting to write to the DB will get a reference to the single broker object. How to assure one object at a time gets write access? Is synchronized code the best way to achieve this. Would one call "notifyall" at the end?
THanks...
Vernon Gibson
Ranch Hand

Joined: Dec 01, 2000
Posts: 35
Douglas,
Is it possible in Access to 'lock' records that are retrieved for update?
Letting the database handle the sequence of events might be the best way to go.
VG
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Getting single-threaded access to a Database
 
Similar Threads
ConnectionPoolilng from MS Access
My results, my Thanks and my Warning
Question for use of EntityBean and SessionBean
jsp methods to database class synronized
Threads 003: Server-Side Strategies