Entity locked

Hi all,

I have this extension that calls an Oracle Stored Procedure (SP).

Everytime that this extension returns an error (from the SP or from the extension source code), the error message is returned to the eSpace and the Action flow continues, but, imagine this flow:

- Action UpdateEntity (Updates Status to "Is Processing")
- Extension Action SP_CreateTable1Record (Returns OK)
- Extension Action SP_CreateTable2Record (Returns Not OK)
- Action UpdateEntity (Updates Status to "Not Processed")
- Extension Action SP_DeleteTable1Record (Returns OK)
- Freeze (now the application freezes and I don't know why)

We have to restart the application pool, and it seems that its working, but when I try to update a record on the Entity (the Entity that I update status), always freezes. I Query the entity and it returns the "Is Processing" status when it suposed to return the "Not Processed".

I supose that the table is locked, but Why? What can I do do avoid that issue? Any suggestions?

Thanks in advance.

Nelson Freitas

P.S:. I attached the extension, just in case anyone wants to read it.
P.S 2:.  I'm currently using the most recent Platform 5.0 release
Hello Nelson,

From the symptoms you describe, it seems you're trying to read uncommited data (something not available in Oracle) and that you're in fact getting yourself into a lock.

The problem seems to be that you're using different transactions to invoke the stored procedures and to execute the application's Update actions.

There are 2 ways to solve this problem. You can either commit your database transaction before executing the Stored Procedure (there's a built-in action for that) or you can use the main transaction to execute the Stored Procedure. You can fetch this transaction by calling DBTransationManager.Current.GetMainTransaction().

Best of luck!
Hi Rodrigo,

thanks for the quick response. Actually, this Stored Procedure calls are from other Database connections and not from the Outsystems DB.

In the Extension you can see that its using DBTransationManager.Current.GetMainTransaction() when someone wants to call a Stored Procedure that its on the current Database. 

However, I will try your first recommendation that is force a commit transaction before every Stored Procedure call, and see how it goes.

Thanks again,

Hello again,

Apparently, the CommitTransacton forcing solution, solved the problem. So I think I can say (like House use to say) that this case is closed :)

Thanks again Rodrigo.