Ask a Question related to IBM DB2, Design and Development.

  1. #1

    Default Re: DB2 locking UDF dll

    Meg wrote:
    > Hello,
    > I'm working on coding a UDF for DB2. Everything is (finally) set up
    > and working ok. But I'm changing the actual c-code for the function
    > as I go. Once I compile and link the project into a .dll, I copy the
    > dll into sqllib/function. However, the problem is that once I run
    > that function from DB2 in order to test thigns out, the dll in
    > sqllib/function is marked as in use. Because of this, I can recompile
    > the dll but can't copy it into sqllib/function without first rebooting
    > in order to get DB2 to "let go" of the dll.....should I be
    > disconnecting from the database or something? all i'm doing is
    > connecting to the database and then using VALUES() to test the
    > function...
    > thanks in advance,
    > meg
    Which version of db2 are you using? For v8, try set KEEP_FENCED to no
    (db2 update dbm cfg using KEEP_FENCED NO). This way, the fenced mode
    process would terminate everytime you disconnect. However, you will
    suffer a significant performance penalty, so this should only be done on
    your development machine and once the udf is finalized, turn that flag
    back on.

    Another alternative is to use ALTER FUNCTION to change the external name
    to point to a different library.

    W Gemini Guest

  2. Similar Questions and Discussions

    1. Contribute is locking up IIS
      Hi, Our client is using Contribute 4 to update an asp.net site. He's been using it without any issues for months, but now he's getting an error...
    2. Locking A Query?
      Greetings. I need some feedback on using cflock with a query. I essentially want to single thread just one piece of code (a query) on a page. ...
    3. Need Help with Locking
      I need help with understanding about locking. I have my DSN created as Application Variable . I want to lock a transaction in one of the module to...
    4. implement locking
      hi, I would like to lock a record so that when one user is modifying a particular record, then it is locked for all other users. For this...
    5. [PHP] locking to domain
      On Saturday 19 July 2003 00:00, Ryan A wrote: echo $_SERVER -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software...
  3. #2

    Default Re: DB2 locking UDF dll


    >
    > Which version of db2 are you using? For v8, try set KEEP_FENCED to no
    > (db2 update dbm cfg using KEEP_FENCED NO). This way, the fenced mode
    > process would terminate everytime you disconnect. However, you will
    > suffer a significant performance penalty, so this should only be done on
    > your development machine and once the udf is finalized, turn that flag
    > back on.
    >
    That’s a good point. In V8, there are more things you should take care:

    ====
    If keepfenced is set to no, and the routine being executed is not
    threadsafe, a new fenced mode process is created and destroyed for each
    fenced mode invocation. If keepfenced is set to no, and the routine being
    executed is threadsafe, the fenced mode process persists, but the thread
    created for the call is terminated. If keepfenced is set to yes, a fenced
    mode process or thread is reused for subsequent fenced mode calls. When the
    database manager is stopped, all outstanding fenced mode processes and
    threads will be terminated.
    =====

    We can see even you set KEEPFENCED as NO, but the UDF routine is THREADSAVE
    (default). That means even all the connections who called fenced UDFs are
    terminated, the fenced mode process still keep alive . So you can kill this
    process – db2fmp, or the better and safer way is you shutdown the db2
    server.


    Regards,
    FRX


    Fan Ruo Xin Guest

  4. #3

    Default Re: DB2 locking UDF dll

    Fan Ruo Xin wrote:
    >
    >>Which version of db2 are you using? For v8, try set KEEP_FENCED to no
    >>(db2 update dbm cfg using KEEP_FENCED NO). This way, the fenced mode
    >>process would terminate everytime you disconnect. However, you will
    >>suffer a significant performance penalty, so this should only be done on
    >>your development machine and once the udf is finalized, turn that flag
    >>back on.
    >>
    >
    >
    > That’s a good point. In V8, there are more things you should take care:
    >
    > ====
    > If keepfenced is set to no, and the routine being executed is not
    > threadsafe, a new fenced mode process is created and destroyed for each
    > fenced mode invocation. If keepfenced is set to no, and the routine being
    > executed is threadsafe, the fenced mode process persists, but the thread
    > created for the call is terminated. If keepfenced is set to yes, a fenced
    > mode process or thread is reused for subsequent fenced mode calls. When the
    > database manager is stopped, all outstanding fenced mode processes and
    > threads will be terminated.
    > =====
    >
    > We can see even you set KEEPFENCED as NO, but the UDF routine is THREADSAVE
    > (default). That means even all the connections who called fenced UDFs are
    > terminated, the fenced mode process still keep alive . So you can kill this
    > process – db2fmp, or the better and safer way is you shutdown the db2
    > server.
    >
    >
    > Regards,
    > FRX
    >
    >
    THREADSAFE is not the default for C UDFs. But I agree, the best way is
    to shutdown the db2 server which would bring down all fmp processes that
    are current running.

    W Gemini Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139