my first idea was to lookup the connection from pool and store it within the session.
But what about browser or network crash , maybe the session timeout must cleanup.
I'm unsure whether this is a good idea.
Do you can use one connection parallel with two session? or must it an exclusive usage?
How the temporary tables handled, e.g. deleted if the session crash?
Also you might open lots of connections in parallel.
Hmm, I don't think storing the connection yourself would be a good idea since I'm using injected persistence contexts anyway. I'd have to get in near the connection pool itself so JPA doesn't know someone is tampering with the connections ;-)
Any Oracle user around that have had to deal with temporary tables and connection pools?