[QFJ-527] Template-based FIX sessions get disconnected on first logon Created: 18/May/10  Updated: 15/Aug/12  Resolved: 15/Aug/12

Status: Closed
Project: QuickFIX/J
Component/s: None
Affects Version/s: 1.4.0
Fix Version/s: None

Type: Bug Priority: Default
Reporter: Scott Harrington Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Relates
relates to QFJ-357 Logout message is sent before Logon o... Closed

 Description   

I have a custom AcceptorSessionProvider similar to DynamicAcceptorSessionProvider.

The Sessions that get created on-the-fly at Logon time sometimes get disconnected right away. If the SessionID has never been seen before, it works fine. The disconnect only happens if the MessageStore has a previous *.session file lying around from a previous day. Subsequent logons by the same client work fine.

The problem was that Session.checkSessionTime always returns false in the constructor, and it caches this result for 1 second. The fix is to NOT cache a negative result. Apologies for my bad habit of posting patches here in the description, but it seems silly to attach a file when the fix is just a single line change:

Index: core/src/main/java/quickfix/Session.java
===================================================================
— core/src/main/java/quickfix/Session.java (revision 950)
+++ core/src/main/java/quickfix/Session.java (working copy)
@@ -489,7 +489,7 @@
// necessary to do for every message received.
//
Date date = SystemTime.getDate();

  • if ((date.getTime() - lastSessionTimeCheck) >= 1000L) {
    + if (!lastSessionTimeResult || (date.getTime() - lastSessionTimeCheck) >= 1000L) {
    Date getSessionCreationTime = state.getCreationTime();
    lastSessionTimeResult = sessionSchedule.isSameSession(SystemTime.getUtcCalendar(date),
    SystemTime.getUtcCalendar(getSessionCreationTime));


 Comments   
Comment by Christoph John [ 15/Aug/12 ]

This was solved in the course of QFJ-357.

Generated at Thu May 02 13:39:55 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.