Re: re: Thread safety

[email protected] Sun, 08 Nov 2009 11:14:34 +1000
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
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, [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/
f92c9b6.jpg (image/jpeg, 4.1 KB) - not displayed