Re: re: Thread safety

abel birya <[email protected]> Mon, 9 Nov 2009 10:35:39 +0300
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
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, <[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, [email protected] <anthony%40berglas.org> 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.
>  
>