Thanks nestorjb, that's helped a lot.
On a side note, it took me a while to figure out that getDelegate was the method I needed to call on EntityManager to get the session. So now, for the benefit of anyone else having the same question, I just do this:
Code:
Connection con = ((Session)entityManager.getDelegate()).connection();
con.setAutoCommit(false);
CallableStatement cs = con
.prepareCall("CALL LOGIN (?,?,?,?)");
cs.setString(1, accountNumber);
cs.setString(2, lastName);
cs.registerOutParameter(3, java.sql.Types.CHAR);
cs.registerOutParameter(4, java.sql.Types.CHAR);
cs.execute();
...and it works!
I noticed that the .connection method is deprecated, although it's not appearing on the site's API docs yet. I checked the source code and it mentions this:
Quote:
Replacement depends on need; for doing direct JDBC stuff use
* {@link #doWork}; for opening a 'temporary Session' use (TBD).
Sounds like the replacement isn't quite ready yet, so I'll continue using .connection for now. If I shouldn't, pls let me know
Thanks again