I'm trying to write a utility that does batch inserts. In my code,
I get the connection manager and then set the batch mode to 'true'.
ConnectionManagerIF conMan = broker.serviceConnectionManager();
boolean saveBatchMode = conMan.isBatchMode();
try
{
conMan.setBatchMode(true);
Then I open a transaction and do the inserts. Looking at the output in
spy.log,
I notice that the inserts are interleaved with selects and deletes. Why does
OJB do this? And does this affect the batching? Are my inserts being done in
a batch or not. I can't tell from the log.
I am using rc4, by the way, with the Persistencebroker API, and MSSqlServer,
and the JSqlConnect driver.
Here is some of the spy.log output
1066659968660|70|0|statement|SELECT
firstName,customerID,type,rowVersion,customerNumber,deleteTag,dateEnrolled,d
eleteTagSetDate,customerName,lastName,subtype,status,address3,address2,addre
ss1,enrollingUserID,middleName,title FROM Customer WHERE customerID = ?
|SELECT
firstName,customerID,type,rowVersion,customerNumber,deleteTag,dateEnrolled,d
eleteTagSetDate,customerName,lastName,subtype,status,address3,address2,addre
ss1,enrollingUserID,middleName,title FROM Customer WHERE customerID = '2'
1066659968680|10|0|statement|INSERT INTO Customer
(customerID,rowVersion,firstName,middleName,lastName,title,address1,address2
,address3,customerNumber,customerName,type,subtype,deleteTag,deleteTagSetDat
e,status,enrollingUserID,dateEnrolled) VALUES
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |INSERT INTO Customer
(customerID,rowVersion,firstName,middleName,lastName,title,address1,address2
,address3,customerNumber,customerName,type,subtype,deleteTag,deleteTagSetDat
e,status,enrollingUserID,dateEnrolled) VALUES
('2','1','Big','','Customer','','','','','1000','BadCorporation','','','fals
e','','','0','')
1066659968710|30|0|statement|DELETE FROM EnrolledForPayment WHERE
customerID=?|DELETE FROM EnrolledForPayment WHERE customerID='2'
1066659968710|0|0|statement|SELECT
firstName,customerID,type,rowVersion,customerNumber,deleteTag,dateEnrolled,d
eleteTagSetDate,customerName,lastName,subtype,status,address3,address2,addre
ss1,enrollingUserID,middleName,title FROM Customer WHERE customerID = ?
|SELECT
firstName,customerID,type,rowVersion,customerNumber,deleteTag,dateEnrolled,d
eleteTagSetDate,customerName,lastName,subtype,status,address3,address2,addre
ss1,enrollingUserID,middleName,title FROM Customer WHERE customerID = '3'
1066659968710|0|0|statement|INSERT INTO Customer
(customerID,rowVersion,firstName,middleName,lastName,title,address1,address2
,address3,customerNumber,customerName,type,subtype,deleteTag,deleteTagSetDat
e,status,enrollingUserID,dateEnrolled) VALUES
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |INSERT INTO Customer
(customerID,rowVersion,firstName,middleName,lastName,title,address1,address2
,address3,customerNumber,customerName,type,subtype,deleteTag,deleteTagSetDat
e,status,enrollingUserID,dateEnrolled) VALUES
('3','1','Big','','Customer','','','','','1001','BadCorporation','','','fals
e','','','0','')
1066659968710|0|0|statement|DELETE FROM EnrolledForPayment WHERE
customerID=?|DELETE FROM EnrolledForPayment WHERE customerID='3'
thanks,
Bonnie MacKellar