Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

GTT - Global Temporary Table - Problem with Apex

877857Jan 5 2012 — edited Jan 6 2012
Hi

I'm having a problem using GTT with Apex. The data generated by a session can be selected by another User in another session. How can this happen?

Thanks

Márcio Gonçalez
This post has been answered by maceyah on Jan 5 2012
Jump to Answer

Comments

maceyah
Answer
Sounds like connection pooling. You might want to try changing your GTT from flush on end of session to flush on commit.
Marked as Answer by 877857 · Sep 27 2020
TexasApexDeveloper
You MIGHT want to read up on GTT's and APEX. Since apex does session sharing, they ARE NOT really supported well in APEX. I would suggest you look at collections, which are a better solution with APEX and temporary data storage..

Thank you,

Tony Miller
LuvMuffin Software
Rod West
Hi,

You need to ensure that your GTTs are created with ON COMMIT DELETE ROWS. If the GTT is created with ON COMMIT PRESERVE ROWS then the contents of the table will be preserved for the life of the session. As Apex reuses sessions from the session pool if you have defined your GTTs with preserve rows you will need to ensure that all rows are deleted from the GTT before the GTT is used in your Apex application.

Rod West
fac586
Rod West wrote:

You need to ensure that your GTTs are created with ON COMMIT DELETE ROWS.
As 710781 to most developers this is likely to be problematic as well. Use APEX collections.
877857
I want to thank everyone for the comments. I put "on commit preserve rows" I did not know that Apex uses connection pooling and this could cause this problem.

thank you

Márcio Gonçalez
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 3 2012
Added on Jan 5 2012
5 comments
2,186 views