I don't know if I understand your problem, sorry if this isn't helpful.
If you're reading the same value from the database in various threads and commit this value in each thread then you have a "false data dependency" also known as write after write conflict. The standard procedure to resolving this conflict is renaming:
- Thread 1 starts and reads the database.
- Thread 1 modifies the data.
- Thread 2 starts and reads the database.
- Thread 1 commits
- Thread 2 modifies the data
- Thread 2 commits
As you can clearly see the data from thread one is lost. If you need the result from thread one you'll have to create another entry in the database.
If you for some other reason need only individual instances of myObject and the writebacks of commit don't interest you I'd suggest to write a wrapper. Something to the likes of
MyObject entry = getValueFromDb();
Wrapper obj=new Wrapper(entry.value);
I have to admit I don't see why you'd need this. My best guess would be static behaviour of MyObject (or here Wrapper) that manages each instance. Maybe giving them an ID or something.
Both the creation of a sufficient number of new entries as well as wrapper class should help you avoid the ugly
class.getInstance().myMethodCall() which is most probably the bottleneck. More entries will require some sort of synchronization though which will in turn yield a (hopefully little) performance impact.