[Quickfix-developers] SessionQualifier not allow null
Brought to you by:
orenmnero
|
From: Vengoal C. <ve...@dd...> - 2005-08-30 00:11:22
|
Hi ,
I want use quickfixj on IBM AS/400. So I create some class upon
jdbcxxxx.java. I also create the Exectuor.java for acceptor. I found the
session table have a Session_Qualifier not allow null value, but when I
start the myown class ,
I got the java.sql.SQLException: [SQL0407] Null values not allowed in
column or variable SESSI00001. the SESSI00001 is the check-constraint
for Session table primary key.
And I saw the the jdbcstore.java code will insert the Session following
information in loadCache()
query.setString(1, sessionID.getBeginString());
query.setString(2, sessionID.getSenderCompID());
query.setString(3, sessionID.getTargetCompID());
query.setString(4, sessionID.getSessionQualifier());
......
insert.execute(); <== this line run error
So I got that error, becuase I didn't set the SessionQualifier at cfg
file. If I set the parameter , I got CfgError: SessionQualifier could
not set at acceptor mode. If SessionQualifier is not defined at cfg
file, the SessionQualifier value always null, so the above statement
never execute normal. If table definition is not NULL. Does the SQL
function correct ?
Following is Exectutor.java code section:
try {
Application application = new Application();
SessionSettings settings =
new SessionSettings(inputStream);
//MessageStoreFactory messageStoreFactory =
// new FileStoreFactory(settings);
//LogFactory logFactory = new ScreenLogFactory(true, true, true);
MessageStoreFactory messageStoreFactory =
new AS400JdbcStoreFactory(settings);
System.out.println("AS400JdbcStoreFactory created");
LogFactory logFactory = new AS400JdbcLogFactory(settings);
System.out.println("AS400JdbcLogFactory created");
MessageFactory messageFactory = new DefaultMessageFactory();
acceptor = new SocketAcceptor
(application, messageStoreFactory, settings, logFactory, messageFactory);
acceptor.start();
System.out.println("press <enter> to quit");
System.in.read();
acceptor.stop();
System.exit(0);
}
following is the error code:
D:\Vengoal\My Documents\FIX\quickfix\quickfixj\bin>as400executor.bat
AS400JdbcStoreFactory created
AS400JdbcLogFactory created
AS400JdbcStoreFactory.create()
AS400JdbcStore.sessionID=FIX.4.2:EXEC->BANZAI
AS400JdbcStore.connect
sessionID.getBeginString()=FIX.4.2
sessionID.getSenderCompID()=EXEC
sessionID.getTargetCompID()=BANZAI
sessionID.getSessionQualifier()=null
cache.getCreationTime().getTime()=2005-08-29 15:17:23.984
AS400JdbcStoreFactory.create() error
java.sql.SQLException: [SQL0407] Null values not allowed in column or
variable S
ESSI00001.
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:643)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:614)
at com.ibm.as400.access.AS400JDBCStatement.commonExecute(AS400JDBCStatem
ent.java:862)
at com.ibm.as400.access.AS400JDBCPreparedStatement.execute(AS400JDBCPrep
aredStatement.java:777)
at quickfix.AS400JdbcStore.loadCache(AS400JdbcStore.java:87)
at quickfix.AS400JdbcStore.<init>(AS400JdbcStore.java:51)
at quickfix.AS400JdbcStoreFactory.create(AS400JdbcStoreFactory.java:24)
at quickfix.Session.<init>(Session.java:175)
at quickfix.DefaultSessionFactory.create(DefaultSessionFactory.java:130)
at quickfix.netty.AbstractSocketAcceptor.initialize(AbstractSocketAccept
or.java:171)
at quickfix.netty.AbstractSocketAcceptor.start(AbstractSocketAcceptor.ja
va:121)
at quickfix.example.as400.fixserver.Executor.main(Executor.java:60)
java.lang.RuntimeException: java.sql.SQLException: [SQL0407] Null values
not all
owed in column or variable SESSI00001.
--
Best Regards,
Vengoal Chang
|