db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarrell, Maury" <Maury.Jarr...@fhr.com>
Subject RE: Oracle 9i TIMESTAMP in primary key problems
Date Thu, 01 Apr 2004 15:30:07 GMT
Bob,

What were the original problems you encountered?  I did a couple of searches
on the list archive and couldn't find them.

Thanks,
Maury

-----Original Message-----
From: Bob Davison [mailto:Bob.Davison@reuters.com] 
Sent: Thursday, April 01, 2004 8:59 AM
To: torque-user@db.apache.org
Subject: Oracle 9i TIMESTAMP in primary key problems

Hi folks,

More problems with the Oracle 9i DATE vs TIMESTAMP issue.

Due to the problems with the Oracle 9i JDBC drivers and DATE columns we
moved to TIMESTAMP columns instead.  This seemed fine until we used one
of these columns in a primary key.

When Torque does an update or delete it builds a WHERE clause based on
the primary key fields, if any of these are dates then it calls the
getDateString() on the DB adapter class.  For DBOracle this results in a
call to the Oracle TO_DATE(...) function.  This function only handles
second granularity, sub-second information is lost, so if your record
had sub-second information in the TIMESTAMP field then the WHERE clause
will fail to identify your record and the UPDATE or DELETE statement
will silently fail to update or delete your record.

It would be possible to modify DBOracle.getDateString to call the Oracle
9i TO_TIMESTAMP() function but that would upset Oracle 8i and earlier
and may not work with DATE columns in Oracle 9i.

I can't see a way to work around these Oracle DATE/TIMESTAMP issues.  We
have put an auto-increment primary key on this table now just so updates
and deletes work.

.../Bob




--------------------------------------------------------------- -
        Visit our Internet site at http://www.reuters.com

Get closer to the financial markets with Reuters Messaging - for more
information and to register, visit http://www.reuters.com/messaging

Any views expressed in this message are those of  the  individual
sender,  except  where  the sender specifically states them to be
the views of Reuters Ltd.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message