Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Problem persisting TimestampTZ with JPA
Problem persisting TimestampTZ with JPA [message #737098] Fri, 14 October 2011 16:52 Go to next message
Jeremy Purdy is currently offline Jeremy PurdyFriend
Messages: 7
Registered: October 2011
Junior Member
Eclipselink 2.1
Tomcat 5.5.26

Using JPA, I am attempting to persist a java.util.Calendar object to an Oracle Timestamp With Time Zone column. From what I have read, Eclipselink is supposed to just handle this for Oracle DB.

However, an attempt at a direct mapping:

public class TimestampTzTest {
private Long id;
private Calendar time;

public Long getId() {
return id;
public void setId(Long id) { = id;
public Calendar getTime() {
return time;

public void setTime(Calendar time) {
this.time = time;

fails during startup because
The attribute [time] from the entity class [class eg.model.TimestampTzTest] does not specify a temporal type.

Next, I try using a TypeConverter

@TypeConverter(name="timestamptz", dataType=TIMESTAMPTZ.class)
private Calendar time;

This results in an error during execution:
Caused by: java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingCallableStatement cannot be cast to oracle.jdbc.OracleCallableStatement
at oracle.sql.TRANSDUMP.getTransitions(
at oracle.sql.TIMEZONETAB.updateTable(
at oracle.sql.TIMESTAMPTZ.toTimestamp(
at oracle.sql.TIMESTAMPTZ.timestampValue(

From what I have found during search, this appears to be caused by the Tomcat connection pool not returning the underlying OracleCallableStatement.

I have not been able to find a solution to this problem. Can someone please guide me?
Re: Problem persisting TimestampTZ with JPA [message #748369 is a reply to message #737098] Mon, 24 October 2011 17:06 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

The issue is that EclipseLink needs to raw Oracle JDBC Connection, but your DataSource is wrapping it.

Either use an EclipseLink connection pool instead, or define an EclipseLink ServerPlatform for Tomcat that unwraps the connection.

James : Wiki : Book : Blog : Twitter
Previous Topic:create-tables doesn't create foreign key constraints
Next Topic:@OneToMany SortedSet
Goto Forum:

Current Time: Fri Jun 22 02:14:37 GMT 2018

Powered by FUDForum. Page generated in 0.01972 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top