SQLJ default context override

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Janick Bernet

    #1

    SQLJ default context override

    When using SQLJ stored procedures in DB2 9, one has to manually create
    a Connextionconte xt 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

  • Janick Bernet

    #2
    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

    Comment

    • Knut Stolze

      #3
      Re: SQLJ default context override

      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

      Comment

      • Philip Wright

        #4
        Re: SQLJ default context override


        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

        Comment

        • Janick Bernet

          #5
          Re: SQLJ default context override

          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

          Comment

          Working...