Re: re: Thread safety
[email protected] Mon, 09 Nov 2009 18:03:40 +1000
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <[email protected]> |
Not normally necessary. And locking is about more than Synchronized. Unlike most software, SimpleORM takes care to try to fail fast if you have threading errors. Anthony At 05:35 PM 9/11/2009, you wrote: > > >Hello Anthony, >Thanks for the reply and I have to say I do understand exactly what you mean. What I am really concerned with is whether I may have to write synchronised methods to restrict how resources are accessed. Is this really necessary while using this package. > >On Sun, Nov 8, 2009 at 4:14 AM, <<mailto:[email protected]>[email protected]> wrote: > > >SimpleORM checks for common threading errors such as trying to use the same *Connection* from two threads. > >It is quite OK and normal to have multiple threads in multiple JVMs accessing the same database, with each thread having its own connection. > >But keeping accesses from different connections from interfering is the job of the database. In normal usage, with normal locking, you should be OK. And SimpleORM double checks all updates with optimistic locks. But the details can be very complex. The white paper has a section. > >Anthony > > >At 01:31 PM 7/11/2009, you wrote: >> >> >>Hello all. >>I have been using SimpleORM for a few months now and it has been a >>great help especially for backend data migration scripts. I shall be >>writing my first full app in about 2 months time. I have been reading >>a lot on thread safety and I wanted to know whether the >>getThreadLocalSession method is enough to ensure thread safety when >>accessing the db or whether I need to have my own implementation to >>ensure that if 30 people or so are connected actions such as inserting >>data to the db are safe and data integrity is maintained. Kindly >>advise. Kind regards. Abel >> > >Dr Anthony Berglas, <mailto:anthony%40berglas.org>[email protected] Mobile: +61 4 4838 8874 >Just because it is possible to push twigs along the ground with ones nose >does not necessarily mean that is the best way to collect firewood. > > > Dr Anthony Berglas, [email protected] Mobile: +61 4 4838 8874 Just because it is possible to push twigs along the ground with ones nose does not necessarily mean that is the best way to collect firewood. ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/SimpleORM/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/SimpleORM/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/