[QFJ-199] Add support for Oracle databases Created: 15/Jun/07  Updated: 28/Nov/07  Resolved: 28/Jun/07

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

Type: Improvement Priority: Critical
Reporter: Jörg Thönnes Assignee: Jörg Thönnes
Resolution: Fixed Votes: 0
Labels: None
Environment:

JDBC



 Description   

If the SessionQualifier is not used, it is left as an empty string.

Some database, e.g. Oracle, treat the empty string as a null value which is not allowed for the SessionQualifier column.

Therefore, I suggest to use a string with exactly one space instead of an empty string if the SessionQualifier is not set.

Steve, what do you think?



 Comments   
Comment by Steve Bate [ 15/Jun/07 ]

We currently don't have any Oracle SQL files for QFJ. Why can't we create those and allow null values for qualifier column? Are there other issues?

Comment by Jörg Thönnes [ 15/Jun/07 ]

(In reply to comment #1)
> We currently don't have any Oracle SQL files for QFJ.

Actually, I plan to add them soon. We now have an Oracle 10g Express installation here.

> Why can't we create those
> and allow null values for qualifier column? Are there other issues?

If the qualifier column is part of the primary key, the non-null constraint is automatically set.

Comment by Jörg Thönnes [ 15/Jun/07 ]

To summarize: If you confirm that the session qualifier is not needed as part of the primary key,
we can allow null values here. Then I would like to change the primary key definition for all supported
databases.

Is there any specific reason why the session qualifier must be part of the primary key?

Comment by Steve Bate [ 15/Jun/07 ]

Technically, it is part of the primary key. That's probably why the QF SessionID has "" instead of null for the default values. I think we should document this limitation of Oracle (treating "" as NULL) and suggest always using a session qualifier with Oracle rather than changing code related to all the other databases.

Comment by Jörg Thönnes [ 16/Jun/07 ]

OK, I will add a comment to configuration.html.

Comment by Wolfgang Grinfeld [ 28/Nov/07 ]

On version 1.3.0, the application still has trouble with Oracle JDBC Store: It crashes with the error:

java.lang.RuntimeException: java.sql.SQLException: ORA-01400: cannot insert NULL into ("WLGRINFELD"
."SESSIONS"."SESSION_QUALIFIER")

A workaround I thought possible follows:

drop index I_Messages;
drop table Messages;
CREATE TABLE Messages (
beginstring VARCHAR2(8) NOT NULL,
sendercompid VARCHAR2(64) NOT NULL,
targetcompid VARCHAR2(64) NOT NULL,
session_qualifier VARCHAR2(64) ,
msgseqnum INTEGER NOT NULL,
message VARCHAR2(4000) NOT NULL
);
create unique index I_Messages on Messages (beginstring, sendercompid, targetcompid, session_qualifier, msgseqnum);

drop index I_Sessions;
drop table Sessions;
CREATE TABLE Sessions (
beginstring VARCHAR2(8) NOT NULL,
sendercompid VARCHAR2(64) NOT NULL,
targetcompid VARCHAR2(64) NOT NULL,
session_qualifier VARCHAR2(64) ,
creation_time TIMESTAMP NOT NULL,
incoming_seqnum INTEGER NOT NULL,
outgoing_seqnum INTEGER NOT NULL
);
create unique index I_Sessions on Sessions (beginstring, sendercompid, targetcompid, session_qualifier);

Generated at Sat Nov 23 07:46:57 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.