Also, you mentioned a doubt about what would happen "if the Session already has a connection that is enlisted into the active JTA transaction". That is not a valid use case imo. What happens to calls on a Session after the SessionFactory is closed is undefined. JPA well defines it for certain cases (certain specific exception requirements when calls are made on an EM after the EMF is closed).
I think that you already answered my question in your previous comment, that we always get a new Connection from the DataSource. My question was really about using the session prior to dropping the schema, not after. |