I'm trying to find the right place to add some code to deal with an Oracle annoyance in a seam/ejb web app.
I've got some columns of type "TIMEZONE WITH LOCAL TIMESTAMP" and because of this I need to call setSessionTimezone on the underlying OracleConnection (mentioned in docs
here) to set the connection's timezone to TimeZone.getDefault().getID()
(way to go setting appropriate defaults Oracle...)For now we've got a Hibernate interceptor jumping through hoops to do this (jndi lookup to get and ejb, persistence context is injected into ejb which then uses it to dig out the Oracle Connection) in the onPrepareStatement callback, but this seems like the wrong place to be doing this.
What I'm looking for is a place to do this that will get called once when a connection is being opened/prepared for use by a request, and wouldn't need an ejb or seam component to dig out the connection from a persistence context. So do you have any suggestions as to where this kind of code can be placed?