Re: Table Locking and Create Index
Posted in 1997
John Morton wrote:
}
} Hi there. We're having some trouble running a dbaccess script to
} drop/create indices. Earlier in the script, lockmode is set to wait
} for 5 minutes:
}
} begin work;
} Started transaction.
}
}
} lock table "tuxedo".system_log in exclusive mode;
} Table locked.
}
}
} create index "tuxedo".slog_idx1 on "tuxedo".system_log
} (system_date,system_hour,
} system_minute,system_sec,system_cust_id) in pslogi01 ;
} 242: Could not open database table (tuxedo.system_log).
}
} 106: ISAM error: non-exclusive access.
} Error in line 2
} Near character position 54
}
} commit work;
} Data committed.
}
} It seems to me that if the table is locked in the transaction, the
} create index shouldn't fail on non-exclusive access. Can anyone offer
} any suggestions?
}
} Thanks,
}
} John Morton
} mortonj@interlog.com
John,
when the create index is issued the table is locked in exclusive mode so
you don't
need to extra issue the lock table in exclusive mode statement.As you
issue this
statements inside a transaction the table will remain locked until a
commit work or
rollback work statement is issued.
Apart from that I tested a similar script on Online 5.01.UD2 on SCO Unix
and it
funktioned without the error message you mentioned, so maybe there is a
problem with
your Informix Engine Version for which you didn't provide any
Information on your message.
HTH
Tolis Varnas
--
+---------------------------------------------------------------------+
| V+K Relational Solutions email: tvarnas@compulink.gr |
| Deligiorgi 26 tvarnas@orbit.de |
| 546 42 Thessaloniki Voice: (30) 31 820270 |
| Greece Fax: (30) 31 865463 |
+---------------------------------------------------------------------+