Working with Oracle Global Temporary Tables

Working with Oracle Global Temporary Tables

Postby nhh » Tue 15 Jul 2014 23:13

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.
nhh
 
Posts: 2
Joined: Tue 15 Jul 2014 23:09

Re: Working with Oracle Global Temporary Tables

Postby nhh » Wed 16 Jul 2014 12:20

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.
nhh
 
Posts: 2
Joined: Tue 15 Jul 2014 23:09

Re: Working with Oracle Global Temporary Tables

Postby Shalex » Thu 17 Jul 2014 09:01

Thank you for your feedback. If you have any questions, please contact us.
Shalex
Devart Team
 
Posts: 7475
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle