|
One thing to note is that WRKOBJLCK will show locks which are really pseudo locks, and which will be released when another process attempts to lock the object and the lock conflicts with the lock shown. One easy way to determine if a lock is a pseudo lock or a real lock is to attempt to get an exclusive lock on the object using interactive SQL specifying SQL statement LOCK TABLE lib/file IN EXCLUSIVE MODE. If you are able to obtain the lock, the lock was a pseudo lock (and if you refresh the WRKOBJLCK screen the lock held disappears). Frances Stewart WebSphere Application Server for iSeries 400 External: (507) 253-2795 Tie-line: 8-553-2795 IBM Rochester "Vijosh A." <vijosh@systsoft.com>@midrange.com on 12/20/2000 01:15:15 AM Please respond to JAVA400-L@midrange.com Sent by: owner-java400-l@midrange.com To: <JAVA400-L@midrange.com> cc: Subject: RE: File Lock Problem Thanks Vijay/Madhavan. Your solution works. One problem still exists. I make one connection for the entire application by globally declaring the Connection variable. So I can close it at application exit point. What happens is that if a database file is accessed for insert/update, wrkobjlck shows the following - Opt Job User Lock Status Scope Thread QZDASOINIT QUSER *SHRRD HELD *JOB Even if I close all the prepare and resultsets, still this remains. Of course unlike the earlier state, it does not keep on increasing. My thinking is that, when the first time a prepare statement is executed the database manager creates a pointer to the table which is attached to the connection pointer. All prepare statements and resultsets created subsequently are attached to this table pointer. So when we close prepare statements and resultsets all these pointers created gets closed, but the table pointer remains open. Probably what I need is a way of closing this table pointer keeping the connection pointer alive. Please do correct me if my thinking is wrong. Is there a way of removing this file lock after the user exits from the program? At the moment even after exiting from the program, the lock remains. Thanks Cheers Vijosh -----Original Message----- From: owner-java400-l@midrange.com [mailto:owner-java400-l@midrange.com]On Behalf Of vijayakumar purushothaman Sent: Wednesday, December 20, 2000 3:25 AM To: JAVA400-L@midrange.com Subject: Re: File Lock Problem check whether all the resources you used were released. It means you should close statement, result set, and importantly connection objects. Each and every system has some limitation in creation of connection objects and if you use some application server like weblogic, you can explicitly fix the number of connection objects. Ensure that the following code is present in your program. Hope this will help you. Please drop your feedback. Vijay. finally{ try{ if(con != null) con.close(); if(statement != null) statement.close(); if(resultset != null) resultset.close(); }catch(SQLException sqle) {} } _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +--- -------------------------------------------------------------- Systems & Software, Mumbai, India Sent using "The PostMaster" by QuantumLink Communications One Internet account, unlimited personal e-mail addresses Get your free copy of "The PostMaster" at http://www.qlcomm.com/ +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +--- +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.