esanchezros / quickfixj-spring-boot-starter

Spring Boot Starter for QuickFIX/J
Apache License 2.0
125 stars 57 forks source link

Regarding JdbcStore managing two sequences in a single record. #124

Closed ydh6226 closed 8 months ago

ydh6226 commented 8 months ago

Hello,

I'm curious about the JdbcStore logic to store the incoming_seqnum and outgoing_seqnum in the same record of the session table.

Since both the incoming and outgoing processes are trying to update the same record, this approach seems to induce a potential race condition and low throughput.

In contrast, FireStore keeps these sequences in separate files.

Is there a specific reason why JdbcStore does not follow a similar approach by keeping the two sequences in separate records?

Are there any advantages to the current logic that I am not aware of?

Thanks for your time and consideration.

esanchezros commented 8 months ago

Hi @ydh6226,

QuickfixJ Spring Boot Starter is just a wrapper around QuickfixJ. It simplifies the configuration required to create and start an Initiator or Acceptor and handles the lifecycle of the Connector.

With regards to the JdbcStore, this is a class from QuickfixJ but if you look at the implementation you will see that both the incoming_seqnum and outgoing_seqnum are inserted, updated, and queried at the same time:

https://github.com/quickfix-j/quickfixj/blob/50d004661424eb3d1d07fe78a90cb91d85946c29/quickfixj-core/src/main/java/quickfix/JdbcStore.java#L93

If you want to know more details of the motivations for such an approach please feel free to raise the question in their repository.

ydh6226 commented 8 months ago

I was mistaken. Thanks