View Single Post

   
  #4 (permalink)  
Old 02-26-2008, 05:59 PM
Sean McKeough
 
Posts: n/a
Default Re: SQLJ Connection Context and SP interportability

The context as it was created/attained by the SP pre v8 was an SQLJ
static entry (everyone got the same context). If you're running non
threadsafe you can get away with a single instance of this connection
object.

Janick wrote:
>>The reason you need a seperate context in 8.1 is that we're
>>multithreading on the JVM. Without a context per thread, threads would
>>run wild over each others objects (cursors etc) closing them, and other
>>bad things.

>
>
> My main question regarding this is (which is not answered in then docu
> and not apperant in the examples): do you need a seperate context
> *class* per procedure or is it enough to have a seperate context
> *instances*. I'm afraid its the first one, but I just can't really
> imagine why, because thread-safety can easily be achieved on different
> instance of the same class.
> Anyone has more insight on the db2-sqlj-internals?
>
> Regards
> - Janick Bernet, SwissASP

Reply With Quote