[Quickfix-developers] quickfixj JdbcStore problem
Brought to you by:
orenmnero
|
From: Staffan U. <sta...@mu...> - 2006-04-24 15:00:16
|
Hello,
Since I stared using a database instead of normal files for storing
messages and session informtion, I've had the problem that my
quickfixj server tried to reset the session when it should not. I
tracked the problem to the code that loads the sessions table into the
memory cahce:
cache.setCreationTime(SystemTime.getUtcCalendar(rs.getDate(1)));
This code truncates the time of day information, so the creation time
actually read is always 00:00:00 in the morning. With a daily session
schedule staring after midnight, quickfixj resets the session every
time it is restarted, or when a client reconnects.
I made the patch below, and things seem to work.
Staffan
Index: src/quickfix/JdbcStore.java
===================================================================
RCS file: /cvsroot/quickfix/quickfixj/src/quickfix/JdbcStore.java,v
retrieving revision 1.17
diff -u -r1.17 JdbcStore.java
--- src/quickfix/JdbcStore.java 24 Mar 2006 19:26:06 -0000 1.17
+++ src/quickfix/JdbcStore.java 24 Apr 2006 14:57:06 -0000
@@ -115,7 +115,7 @@
try {
rs = query.executeQuery();
if (rs.next()) {
- cache.setCreationTime(SystemTime.getUtcCalendar(rs.getDate(1)));
+ cache.setCreationTime(SystemTime.getUtcCalendar(rs.getTimestamp(1)));
cache.setNextTargetMsgSeqNum(rs.getInt(2));
cache.setNextSenderMsgSeqNum(rs.getInt(3));
} else {
|