Lock mode
Posted in 2009
Topics: General Discussion
Is there a way to set "lock mode to wait" once for a program or does it need to be reset for every single session to the database? Is there a configuration parameter (on the database side) to set the lock mode to wait for all sessions coming to the database? Thanks _________________________________________________________________ Internet explorer 8 lets you browse the web faster. http://go.microsoft.com/?linkid=9655582
>Is there a way to set "lock mode to wait" once for a program or does it need to >be reset for every single session to the database? > >Is there a configuration parameter (on the database side) to set the lock mode >to wait for all sessions coming to the database? If you are using 11.10 or newer, you could look into the sysdbopen functionality. I believe it's documented in chapter 6 of the guide to SQL Syntax manual. Jacques Renaut IBM IDS APD team
Hi, Yes, there is a way to accomplish the result, but it's not a configuration parameter. Assuming you're on IDS 10.00 or later, use the public sysdbopen() function t o execute the "set lock mode" statement. That avoids having to make any changes to your programs. See the Guide to SQL: Syntax manual for details. In effect you're resetting the lock mode for each session, but this does it outside of any program in a single piece of code to maintain. For releases prior to IDS 10 or using Standard Engine, I don't think there's any way to accomplish your goal. Cheers, Dick Snoke IBM Data Management - ChannelWorks dsnoke@us.ibm.com (404) 487-1595 From: "Georges Martin" <georges_martin_1@hotmail.com> To: ids@iiug.org Date: 05/12/09 02:47 PM Subject: Lock mode [15715] Sent by: ids-bounces@iiug.org Is there a way to set "lock mode to wait" once for a program or does it need to be reset for every single session to the database? Is there a configuration parameter (on the database side) to set the lock mode to wait for all sessions coming to the database? Thanks _________________________________________________________________ Internet explorer 8 lets you browse the web faster. http://go.microsoft.com/?linkid=9655582 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
No, but if you are using IDS 11.10+ (it's always helpful to post your IDS version and platform so suggestions can be specific to you) you can use the new optional user login function (sysdbopen) to set session conditions for all users or for specific users. You can create a function named sysdbopen() and whatever commands it contains will be executed for every session that connects. In there you could run the SET LOCK MODE TO WAIT ...; command. Art Art S. Kagel Oninit (www.oninit.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Oninit, the IIUG, nor any other organization with which I am associated either explicitly or implicitly. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, May 12, 2009 at 2:46 PM, Georges Martin < georges_martin_1@hotmail.com> wrote: > Is there a way to set "lock mode to wait" once for a program or does it > need > to be reset for every single session to the database? > > Is there a configuration parameter (on the database side) to set the lock > mode > to wait for all sessions coming to the database? > > Thanks > > _________________________________________________________________ > Internet explorer 8 lets you browse the web faster. > http://go.microsoft.com/?linkid=9655582 > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001636c5b1f462c7200469bc8f20
I don't quite understand your question... Usually a program establishes just one connection to the database... Once you SET LOCK MODE TO... in a session it will keep it for the duration of the session (until another SET LOCK MODE... instruction is sent). As others said, IDS 11.10+ has a functionality which you can use to redefine the LOCK MODE (an other options) without changing the application code. That functionality is the special sysdbopen() procedure which can be seen as a sort of .profile of a session. Note that this was introduced in IDS 11.10, not v10. Finally, if your application uses JDBC the driver supports a property to automatically define the LOCK MODE. Unfortunately this is not supported for other types of connections (ODBC/.NET/OLEDB would be nice...) If this is not enough, please give us more information. Regards. On Tue, May 12, 2009 at 7:46 PM, Georges Martin < georges_martin_1@hotmail.com> wrote: > Is there a way to set "lock mode to wait" once for a program or does it > need > to be reset for every single session to the database? > > Is there a configuration parameter (on the database side) to set the lock > mode > to wait for all sessions coming to the database? > > Thanks > > _________________________________________________________________ > Internet explorer 8 lets you browse the web faster. > http://go.microsoft.com/?linkid=9655582 > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently... --001e680f17501821a70469be2370