Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 25th, 2007, 09:25 AM
Janick Bernet
Guest
 
Posts: n/a
Default SQLJ default context override

When using SQLJ stored procedures in DB2 9, one has to manually create
a Connextioncontext if the procedure should be threadsafe. Now to use
this context one has also to prexif each #sql {} statement by this
context, like this "#sql [context] {}". I wondered if there is a
convenienc function available, to set the manually created context as
the new default for the rest of the stored procedure so just writing
"#sql {}" will use the manually defined context, not the default one.

Regards,
Janick

  #2  
Old August 3rd, 2007, 11:05 AM
Janick Bernet
Guest
 
Posts: n/a
Default Re: SQLJ default context override

Noone?

I start to wonder if I'm the only one using SQLJ in DB2, because I
seem to be the only one always running in such problems :(

Regards,
Janick

  #3  
Old August 3rd, 2007, 11:15 AM
Knut Stolze
Guest
 
Posts: n/a
Default Re: SQLJ default context override

Janick Bernet wrote:
Quote:
Noone?
>
I start to wonder if I'm the only one using SQLJ in DB2, because I
seem to be the only one always running in such problems :(
I would never rely on the default context in the first place and rather
specify the context explicitly - always. That doesn't answer your
question, though.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
  #4  
Old August 3rd, 2007, 01:25 PM
Philip Wright
Guest
 
Posts: n/a
Default Re: SQLJ default context override


Janick Bernet wrote:
Quote:
>
I start to wonder if I'm the only one using SQLJ in DB2, because I
seem to be the only one always running in such problems :(
>
Regards,
Janick
>

No, there are more of us out there!

-Philip
  #5  
Old August 6th, 2007, 10:35 AM
Janick Bernet
Guest
 
Posts: n/a
Default Re: SQLJ default context override

On 3 Aug., 12:03, Knut Stolze <sto...@de.ibm.comwrote:
Quote:
Janick Bernet wrote:
Quote:
Noone?
>
Quote:
I start to wonder if I'm the only one using SQLJ in DB2, because I
seem to be the only one always running in such problems :(
>
I would never rely on the default context in the first place and rather
specify the context explicitly - always. That doesn't answer your
question, though.
>
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
That's exactly why I thought there should be a better way to do it: If
you cannot relay on the default context, why can't I define my own
default?
Or why not make the default one threadsafe? Or why not at least give a
warning when you use the default context (that should be easy to
implement)?
As it is right now, if you forget to specifiy your own context you
will not very likely catch this in testing, but somewhere in
production it will blow in your face...

@Philip: Good to know :)

Regards,
Janick

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles