Community
Showing results for 
Search instead for 
Do you mean 
Reply

Unable to update a history

Copper Contributor
Posts: 191
Country: Netherlands

Unable to update a history

We have an add-on Email2Act! which attaches email messages from Outlook to Act! history items-with-attachment. This is done using the SDK.

 

But every so often we get this message from the framework: Unable to update a history.

What can be the cause of this, and how can we create a workaround for this? Or is it an Act! SDK bug?

 

Full stack trace:

 

 

System.Exception: "Unable to update a history" ---> Act.Framework.Contacts.ContactManagerDB+ContactManagerDBException: Error setting Last fields ---> Act.Data.ActDb.ActDbException: Transaction (Process ID 95) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. ---> System.Data.SqlClient.SqlException: Transaction (Process ID 95) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

bij System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
bij System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
bij System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

bij System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

bij System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)

bij System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)

bij System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

bij Act.Data.ActDb.ActDbCommand.ExecuteNonQuery()

--- Einde van intern uitzonderingsstackpad ---

bij Act.Data.CommandProcessor.ExecuteNonQuery(String connectionString, String statement)

bij Act.Framework.Contacts.LastFieldManagerDB.SetLastField(Guid[] keys, LastFieldType[] lastFieldTypes, DateTime when, CommandProcessor processor)

--- Einde van intern uitzonderingsstackpad ---
bij Act.Framework.Histories.HistoryManagerDB.UpdateEditFields(History history, CommandProcessor processor)
bij Act.Framework.Histories.HistoryManagerDB.UpdateHistory(History tmpHistory)
--- Einde van intern uitzonderingsstackpad ---
bij Act.Framework.Histories.HistoryManagerDB.UpdateHistory(History tmpHistory)
bij Act.Framework.Histories.HistoryManagerDB.EditData(Object data)
bij Act.Framework.Histories.History.Update()

Greetings,

ACT Certified Consultants
TendenZ
the Netherlands
Administrator
Posts: 296
Country: United States

Re: Unable to update a history

This appears to be a deadlock condition where the command processor for SQL said it had to choose a victim session to break the chain.

 

Here is a description of the condition:

https://www.google.com/search?q=sql+deadlock+error&rlz=1C1GCEU_enUS821US821&oq=SQL+Dea&aqs=chrome.2....

 

This may be due to an SDK bug but we will need to repro as these issues can get pretty difficult when it comes to deadlocks.

 

Can you reproduce in a sample app or plugin where we can trace in real time better?

 

 

Copper Contributor
Posts: 191
Country: Netherlands

Re: Unable to update a history

[ Edited ]

No, unfortunately we cannot.  It doesn't happen all the time, and it never happens on the development machines. 

It does happen (a lot) on our terminal server with all users using the tool, but again, not all the time.

 

That said, we already tested performing the history creation on the main UI thread (the one the ActApplication instance is on), but it still occurs.

 

Another problem sometimes also arises, also with 'Unable to insert a history', but this one is not about deadlockes, but:

(see attachment).

 

It actually sais in Dutch that the file it's going to write (the history attachment) is being used by another process. that's kind of weird isn't it?

 

Greetings,

ACT Certified Consultants
TendenZ
the Netherlands