you can refer to the following code, The error is an random issue, cannot be reproduced steadily. and two table is a simple and regular tables. because i try many ways , but cannot find any ways t improve the testcase, so do you know what can we do to improve it to avoid the error based on using insert_recordset.
Table1 : regular table, Fields: StrField, copyCreatedDateTime(Type: utcDateTime), copyModifiedDateTime(Type:utcDateTime)
Table2: regular table, Field: Field1, set properties of Created Date Time and Modified DateTime to Yes
class Class1 extends SysTestCase
{
Table2 table2;
public void setUp()
{
ttsbegin;
table1.Field1 = "testField";
table1.insert();
ttscommit;
}
[SysTestCheckInTest]
public void testMethod()
{
// Arrange.
Table1 table1;
Table2 localTable2;
// Execute.
table1.selectForUpdate(true);
ttsbegin;
insert_recordset table1(CopyCreatedDateTime, CopyModifiedDateTime, StrField)
select CreatedDateTime, ModifiedDateTime, Field1
from localTable2;
ttscommit;
}
}