Page 1 of 1

Working with Oracle Global Temporary Tables

Posted: Tue 15 Jul 2014 23:13
by nhh
I am looking to implement Oracle Global Temporary Tables (GTT) for an existing application using dotConnect for Oracle product (v6.30). The GTT is setup to be transaction based versus session based.

I have proved the concept of writing a value to the GTT via a Store Procedure, updating a table (test_table), and using an update trigger on the table (test_table) to retrieve the value placed on the GTT by the Store Procedure. Of course, issuing a commit deletes the row from the GTT. So, conceptually everything works as expected.

When using the Entity Framework to perform the same actions in code:
Entities.RunStoreProcedure(“my_value”)
// Do some stuff
Entities.SaveChanges


Upon executing an Entities.SaveChanges(), I get the following execption: {"Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries."}

Is this fundamentally not possible using the EF or am I using the wrong approach in trying to implement the use of GTT with Entity Framework?

Thanks in advance.

Re: Working with Oracle Global Temporary Tables

Posted: Wed 16 Jul 2014 12:20
by nhh
Just a quick update...

I modified the code to the following and that appears to work as expected:

Entities.Connection.Open
Trans = Entities.Connection.BeginTransaction
Entities.RunStoreProcedure(“my_value”)
// Do some stuff
Entities.SaveChanges
beginTransaction.commit


By tying everything together within the context of a transaction, the write to the GTT, and retrieving the value, worked as expected.

Re: Working with Oracle Global Temporary Tables

Posted: Thu 17 Jul 2014 09:01
by Shalex
Thank you for your feedback. If you have any questions, please contact us.