Hi,

> Yes, I use Timestamp.setTime(long mills) to update a temporary
> Timestamp object,
> then call JDBC to insert into DB, and these operations are enveloped
> in a loop.

In theory, what you do should work. Except if you share the same
timestamp object by multiple threads (in which case the timestamp
object might change between reading the millis and the nanos, which
can't be solved).

Possibly it's a problem for this version of H2 even if you only use
one thread. There should be a special test case. Probably in the
newest version of H2 this problem is solved however, as
java.sql.Timestamp is no longer used internally (within the
ValueTimestamp object).

> So you mean I should always new a Timestamp object before each JDBC call for 
> a Timestamp field ?

Well, if you use multiple threads, then you need to ensure each thread
uses its own object. Otherwise you should be fine.

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to