Metacat hang in there when delta T replication
There are two metacats A and B. We send a command to B to excute delt T
replication from A. So B will send a update command and get docid list from A,
insert new or updated docid into local server. But when B donwload about 20
documents, it always hang in there. If you send a another command to excute
delt T replication. It donwload another couple doucments. At last, it couldn't
#1 Updated by Jing Tao over 17 years ago
It is found that after inserting a data file ( not for every data file), the
hang problem will happend. So we opened the debug information for database.
From debug information of postgresql, we knew after registering the data file
into xml_documents table, then the next xml documents couldn't insert into
xml_documents table and stopped there when the problem happened. From the
observation, the data file seemed successfully registered into xml_documents
table. Howerver, it didn't. I think the unsuccessful registering of data file
caused the stopping of next xml document inserting.
So we think, for some reason, the registerDocument method check out a db
connection which autoCommit value equlas false ( I am not sure why this
happend), but after insert into xml_documents table, we didn't commit it ( the
defualt value of autoCommit is true). So the data file didn't insert into
Our solution is simple. In registerDocument method, before excecute the insert
sql command, set autoCommit value false for the dbconnection. Then commit it.
Before check the dbconnection in, set autoCommit value true.
I tested the code by replication 347 document from one metacat to another
metacat. The hang problem didn't happend again.