Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Temporary tables and restricted transactions
Wed, Jan 23 2008 10:26 AMPermanent Link

"Jose Eduardo Helminsky"
Tim

I have been looking the source code of DBISAM and I have some doubts:

If I have to create some temporary tables (explicit created) in the database
path, could a restricted transaction lock the wrong table because dbisam.lck
structure doesn´t know about this temporary table ?

Let me explain better:

Database tables:
T100
T200
T300

Process A locks the table T200 and T300

Process B will create T250 and after that locks the table T100 and T250.

I realize DBISAM sort the table list before start a transaction but how can
DBISAM change the dbisam.lck file to adjust T250 after T200 and before T300
creating a new "slot" to lock ? It could lock/unlock wrong tables ?

What moment DBISAM change the file dbisam.lck and is it made inside a
critical section (I suppose) ?

Eduardo

Wed, Jan 23 2008 2:26 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Eduardo,

<< If I have to create some temporary tables (explicit created) in the
database path, could a restricted transaction lock the wrong table because
dbisam.lck structure doesn´t know about this temporary table ? >>

No.  The dbisam.lck file is checked before any table open, and tables use
fixed slots that cannot be re-arranged as long as any process has the lock
file open (i.e. it has any table open).

<< I realize DBISAM sort the table list before start a transaction but how
can DBISAM change the dbisam.lck file to adjust T250 after T200 and before
T300 creating a new "slot" to lock ? It could lock/unlock wrong tables ? >>

No.  The table's aren't populated alphabetically as new tables are created -
they are populated in the order that they appear as a new table.

<< What moment DBISAM change the file dbisam.lck and is it made inside a
critical section (I suppose) ? >>

The lock file is only read/changed under global read/write locks that are
respected by all processes and threads.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image