lockandrun

tony.malandain
Posts: 57
Joined: Sat Mar 27, 2004 6:39 pm

lockandrun

Post by tony.malandain »

I took a look at the SYSPERMS table and there is no entry for the table causing the error in ipreparetree.
Is there a way we can trace the sql commands run and see why this line is never added?

My sql script used to create the table looks like this:

DROP TABLE PropertyStore;
DROP TABLE FileStore;

-- Set Index Directory --
--SET INDEXSPACE='F:\';

-- Create the PropertyStore Table and indexes --
CREATE TABLE PropertyStore
(
DocumentUrl
VARCHAR(255)
NOT NULL
PRIMARY KEY,
Hash
CHAR(50),
DocumentIdentifier
CHAR(40)
NOT NULL,
SessionIdentifier
CHAR(40)
NOT NULL,
LastVerified
DATE
);

CREATE UNIQUE INDEX DocUrlIndex on PropertyStore (DocumentUrl);
CREATE INDEX DocUrlHashIndex on PropertyStore(DocumentUrl, Hash);

-- Create The FileStore table and index --
CREATE TABLE FileStore
(
DocumentIdentifier
CHAR(40)
NOT NULL
PRIMARY KEY,
PageNumber
INTEGER
NOT NULL
PRIMARY KEY,
PlainText
VARCHAR(1000)
NOT NULL,
BinaryContent
BLOB
);


CREATE METAMORPH INVERTED INDEX FTPlainTextIndex on FileStore(PlainText);
CREATE UNIQUE INDEX DocIdentifierPageNumberIndex on FileStore(DocumentIdentifier, PageNumber);
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

lockandrun

Post by mark »

Dropping the table will clear it's entry in SYSPERMS. If you want non-default perms you need to recreate them after recreating the table.

A table can't be dropped while someone else is using it (drop will block until they're finished, then continue with drop). That's why lockandrun prevents the drop. And, obviously, once dropped the loader will fail miserably until it's recreated (along with any required perms).

I think you need more of an application level lock. Your admin program should create a lock file of it's own indicating the table is not available, then drop, setup perms etc., then remove lock file. The loader should check for the lock file and wait if found.
Post Reply