Professional Web Applications Themes

DB2 locking UDF dll - IBM DB2

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 > ...

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

  3. #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

Similar Threads

  1. Page Locking Up
    By llf0652 in forum Macromedia Contribute General Discussion
    Replies: 5
    Last Post: February 16th, 07:17 PM
  2. Need Help with Locking
    By CFRAM in forum Coldfusion - Advanced Techniques
    Replies: 6
    Last Post: July 28th, 03:16 AM
  3. Locking Objects
    By Rick Waugh in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: May 25th, 08:11 PM
  4. File locking for all my needs
    By Matija Papec in forum PERL Miscellaneous
    Replies: 0
    Last Post: September 9th, 09:38 PM
  5. Pessimistic locking
    By Ian Smith in forum Microsoft Access
    Replies: 0
    Last Post: July 23rd, 05:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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