TransactionController.MODE_RECORD,
TransactionController.ISOLATION_SERIALIZABLE);
// Create a base row template.
DataValueDescriptor[] base_row = TemplateRow.newU8Row(2);
RowLocation base_rowloc = base_cc.newRowLocationTemplate();
T_SecondaryIndexRow index_row_from_base_row = new T_SecondaryIndexRow();
index_row_from_base_row.init(base_row, base_rowloc, 3);
((SQLLongint)base_row[0]).setValue(1);
// Create a row.
T_SecondaryIndexRow index_row = new T_SecondaryIndexRow();
index_row.init(TemplateRow.newU8Row(2),
base_cc.newRowLocationTemplate(), 3);
// test: make sure scan position is right after inserts before scan
// no split case. In this case the slot position of the current
// position should change, but the code will keep a record handle
// and not need to reposition by key.
// before keys: 1000, 3000
// last key gotten froms scan : 0
// insert keys:1-900
// next key from scan should be: 5
// insert 1000
((SQLLongint)base_row[1]).setValue(1000);
base_cc.insertAndFetchLocation(base_row, base_rowloc);
if (index_cc.insert(index_row_from_base_row.getRow()) != 0)
{
throw T_Fail.testFailMsg("insert failed");
}
// try each of the unsupported interfaces:
try
{
index_cc.delete(null);
return(FAIL("t_006: ConglomerateController.delete() succeeded."));
}
catch (StandardException e)
{
}
try
{
if (!index_cc.fetch(
null, RowUtil.EMPTY_ROW, (FormatableBitSet) null))
{
return(FAIL("t_006: ConglomerateController.fetch() bad ret."));
}
return(FAIL("t_006: ConglomerateController.fetch() succeeded."));
}
catch (StandardException e)
{
}
try
{
index_cc.insertAndFetchLocation((DataValueDescriptor[]) null, null);
return(FAIL(
"t_006: ConglomerateController.insertAndFetchLocation() succeeded."));
}
catch (StandardException e)
{
}
try
{
RowLocation rowloc = index_cc.newRowLocationTemplate();
return(FAIL(
"t_006: ConglomerateController.newRowLocationTemplate() succeeded."));
}
catch (StandardException e)
{
}
try
{
index_cc.replace(null, null, null);
return(FAIL("t_006: ConglomerateController.replace() succeeded."));
}
catch (StandardException e)
{
}
index_cc.close();
// open a new scan
ScanController scan =
tc.openScan(create_ret.index_conglomid, false,
0,
TransactionController.MODE_RECORD,
TransactionController.ISOLATION_SERIALIZABLE,
(FormatableBitSet) null,
null, ScanController.NA,
null,
null, ScanController.NA);
int numrows = 0;
while (scan.next())
{
numrows++;
scan.fetch(index_row_from_base_row.getRow());
try
{
scan.fetchLocation(null);
return(FAIL("t_006: scan.fetchLocation() succeeded"));
}
catch (StandardException e)
{
}
try
{
RowLocation rowloc = scan.newRowLocationTemplate();
return(FAIL("t_006: scan.newRowLocationTemplate() succeeded"));
}
catch (StandardException e)
{
}