Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Possible Bug: @ReturnUpdate drops timestamps from all dates


A good post describing the reason for the problem is at:
  http://forums.oracle.com/forums/thread.jspa?threadID=191488&start=15&tstart=0
I believe the connection looks at the property when it is created, so the oracle.jdbc.V8Compatible=true property might need to be set in the connection string property list.  Depending on the driver though, you can set it as a system property (depending on driver being used, the forum post says JDBC driver 10.1.0.x should support the system property). 

Best Regards,
Chris

On 30/06/2010 8:28 PM, Tim Hollosy wrote:
Thanks James - bug 318532  filed.

Can you point me in the direction on how I'd customize the driver to
use the backwards compatibility mode in eclipselink?  I'm using spring
and c3po, would it have to be done at the datasource level or could I
do it in EL? Changing the oracle data types is not an option -- legacy
system :)

./tch



On Tue, Jun 29, 2010 at 11:46 AM, James Sutherland <jamesssss@xxxxxxxxx> wrote:
  
The issue is that the returned output parameters are retrieved using
Statement.getObject(), but on Oracle getObject() for the DATE type returns
java.sql.Date, getTimestamp() must be used to get the time portion.  This is
a bug in how EclipseLink retrieves the return row, it should instead be
using the same code used to access a ResultSet.  Please log a bug for this
an vote for it.

A solution is to switch your type in Oracle to use TIMESTAMP as DATE in
Oracle now means only a date, no time.  The JDBC driver also has a backward
compatibility option to have getObject() return Timestamp.


tch wrote:
    
This is very odd,
When using @ReturnUpdate to manage a Modified_On column (Oracle Date
type). The timestamp is missing from the refreshed object until the
container is restarted.

It's really odd, I do a save and then a refresh in the refreshed
object, and in all future ReadAllQueries even against that object the
timestamp is coming back as midnight. This happens on
java.sql.Timestamp types as well as java.util.Date with @Temporal and
a timestamp.

It's funny because it doesn't happen with @ReturnInsert any clue at
all, this seems to weird to be an actual bug and I'm not going to rule
out user error. Any comments before I file a bug report?


./tch


      
-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.nabble.com/EclipseLink-f26430.html EclipseLink
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
--
View this message in context: http://old.nabble.com/Possible-Bug%3A-%40ReturnUpdate-drops-timestamps-from-all-dates-tp28993487p29025207.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

    
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
  

Back to the top