SQL Server Internal Server Error Message

Hello,

I am using Relativity for the first time and for the most part things are going well. However, I just tried adding a script as shown below and now I’m getting an internal server error message from our SQL Server.

// Called before each change is applied to the database
function beforeProcessDeltaChange(delta, change, wasRefreshed, canRemove)
{
if (!change.isInsert) {
  return;
}

// Query the database for the company name
// Remember - this is DA SQL, not a real SQL
var sql = 'SELECT company FROM bsiCustomers WHERE branch=:pBranch AND custID = :pCustID';
var params = { pBranch : 'pittsburgh', pCustID : 2180 };
var selectResult = lda.selectSQL(sql, params);
var row = selectResult.nextRow();

change.newValues['company'] = row['company'];
}

RemObjects.DataAbstract.DAException: An exception occurred on the server: Transaction aborted. Internal DB server error: This SqlTransaction has completed; it is no longer usable.
Inner Exception: InvalidOperationException: This SqlTransaction has completed; it is no longer usable.
at RemObjects.SDK.Message.ProcessException()
at RemObjects.SDK.BinMessage.InternalReadFromStream(Stream stream)
at RemObjects.SDK.Message.ReadFromStream(Stream stream)
at RemObjects.SDK.IpHttpClientChannel.IntDispatch(Stream request, IMessage response)
at RemObjects.SDK.ClientChannel.Dispatch(IMessage message)
at RemObjects.SDK.DynamicRequest.InternalMakeRequest()
at RemObjects.SDK.DynamicRequest.MakeRequest()
at RemObjects.DataAbstract.RemoteDataAdapter.InternalUpdate(Delta[] deltas)
at RemObjects.DataAbstract.DataAdapter.InternalUpdate(DataSet dataset, String[] tableNames)
at RemObjects.DataAbstract.DataAdapter.Update(DataSet dataset, String[] tableNames)
at RemObjects.DataAbstract.DataAdapter.Update(DataSet dataset)
at VPIClient.DataModule.ApplyUpdates(DataTable table) in c:\Projects\Internal Software\VPI Windows\VPIClient\DataModule.cs:line 366
at VPIClient.fmConflictResolutionCenter.UploadISO9000(DataSet ds) in c:\Projects\Internal Software\VPI Windows\VPIClient\fmConflictResolutionCenter.cs:line 385
at VPIClient.fmConflictResolutionCenter.UploadInspections(DataSet ds) in c:\Projects\Internal Software\VPI Windows\VPIClient\fmConflictResolutionCenter.cs:line 345
at VPIClient.fmConflictResolutionCenter.toolStripButton1_Click(Object sender, EventArgs e) in c:\Projects\Internal Software\VPI Windows\VPIClient\fmConflictResolutionCenter.cs:line 118

Any thoughts on where I should begin to look ?

Hello

Well, the easiest would be to sed to support@ the following:

  • DDL for the bsiCustomers table and for the table you try to insert data into
  • the .daSchema file you use (if this is a Relativity Server then you can dowload the Schema from it using the Relativity AdminTool)

This will allow me to reproduce the issue locally to say what is wrong.

I think I just accidentally discovered my issue. There was an error on the SQL Server which caused it to abort the transaction.

The problem was actually cause by a data integrity issue on the server. I specified the pittsburgh branch and customer 2180 but 2180 was a customer of another branch. The correct value I should have specified was 2108.