If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Doing Oracle to Informix Conversion - Database Locking Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-16-05, 17:38
MBlackB MBlackB is offline
Registered User
 
Join Date: Nov 2005
Posts: 1
Doing Oracle to Informix Conversion - Database Locking Question

This is a snipet of an email that I recieved from a co-worker. Thought I would post this here and see if anyone could help. We are rather new at Informix and any assistance would be Greatly appreciated.

------------------------------------------

I was doing some testing to ensure that our database deadlock processing code works correctly. I have two options in a test utility to facilitate this. To run the test you have to have two copies of the utility running in different terminal sessions.

The first option selects a row from table A for update, waits for the user to allow the test to proceed and then selects a row from table B for update. The second option selects a row from table B for update, waits for the user to allow the test to proceed and then selects a row from table A for update. This should produce a deadlock condition.

I simply wanted to ensure that I really have the rows locked in the database. Hence the question of how do you view locks in the database.

In Oracle I would run this query to view the locks. This very Oracle specific. I just wanted to know how to do it in Informix.

select os_user_name "User", object_name "Object", program "Program",
machine "Machine",terminal "Terminal", to_char(sysdate, 'yyyy-mon-dd hh:mi:ss') "Time"
from v$locked_object, dba_objects, v$session
where v$locked_object.object_id = dba_objects.object_id and
v$locked_object.session_id = v$session.sid
Reply With Quote
  #2 (permalink)  
Old 11-16-05, 18:07
blackguard blackguard is offline
Registered User
 
Join Date: Sep 2002
Posts: 102
To know if there are deadlocks, do an onstat -p.

To check for locks in the database, you can query the syslocks system table.

Be sure that you have a row lock level on your tables.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On