By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,254 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

SQLJ default context override

P: n/a
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

Jul 25 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

Aug 3 '07 #2

P: n/a
Janick Bernet wrote:
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
Aug 3 '07 #3

P: n/a

Janick Bernet wrote:
>
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
Aug 3 '07 #4

P: n/a
On 3 Aug., 12:03, Knut Stolze <sto...@de.ibm.comwrote:
Janick Bernet wrote:
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
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

Aug 6 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.