|
From: Grant B. <gbi...@co...> - 2009-06-03 05:02:23
|
Our application needs to use a DB store, and per our customer's
requirements, that DB must be Oracle. Unfortunately for me, I can't
get it working. (We have no trouble when we use MySQL as the store's
DB.)
During construction of the SocketInitiator, I'm getting the following exception:
java.sql.SQLException: ORA-01400: cannot insert NULL into
("ORACLEMAN"."SESSIONS"."SENDERLOCID")
The stacktrace (below) shows that the exception originates deep in the
ojdbc jar. I'm not sure how to investigate this. Is there any way to
see the DB query that is causing this? (Would that even be useful?)
I'm an Oracle novice.
I'm guessing that some default value is the empty string, which Oracle
converts to NULL when QuickFIX/J writes it to the store. I've
specified a SessionQualifier as needed by Oracle as indicated by the
config page. Besides that, I'm not sure what object has the faulty
default value. As I said, it happens in the SocketInitiator
constructor, which is earlier than I'd expect something like this.
Has anyone else successfully used an Oracle DB message store?
Stacktrace, code snippet, and config file contents are below. I'm
using QuickFIX/J 1.4.0. Any help would be greatly appreciated.
Thanks
-Grant
The full stacktrace:
quickfix.ConfigError: error during session initialization
at quickfix.mina.initiator.AbstractSocketInitiator.createSessions(AbstractSocketInitiator.java:135)
at quickfix.mina.initiator.AbstractSocketInitiator.createSessionInitiators(AbstractSocketInitiator.java:84)
at quickfix.SocketInitiator.initialize(SocketInitiator.java:84)
at quickfix.SocketInitiator.start(SocketInitiator.java:64)
at webmquickfixadapter.IceFixApplication.start(IceFixApplication.java:125)
at webmquickfixadapter.Main.main(Main.java:52)
Caused by: java.lang.RuntimeException: java.sql.SQLException:
ORA-01400: cannot insert NULL into
("ORACLEMAN"."SESSIONS"."SENDERLOCID")
at quickfix.JdbcStoreFactory.create(JdbcStoreFactory.java:47)
at quickfix.Session.<init>(Session.java:338)
at quickfix.DefaultSessionFactory.create(DefaultSessionFactory.java:156)
at quickfix.mina.SessionConnector.createSession(SessionConnector.java:114)
at quickfix.mina.initiator.AbstractSocketInitiator.createSessions(AbstractSocketInitiator.java:129)
... 5 more
Caused by: java.sql.SQLException: ORA-01400: cannot insert NULL into
("ORACLEMAN"."SESSIONS"."SENDERLOCID")
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:970)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3476)
at quickfix.JdbcStore.loadCache(JdbcStore.java:139)
at quickfix.JdbcStore.<init>(JdbcStore.java:86)
at quickfix.JdbcStoreFactory.create(JdbcStoreFactory.java:45)
... 9 more
Code for setting up the store and connection:
final SessionSettings settings = new SessionSettings(new
FileInputStream(_quickfixConfigFilename));
final JdbcStoreFactory factory = new JdbcStoreFactory(settings);
final OracleConnectionPoolDataSource ds = new
OracleConnectionPoolDataSource();
ds.setURL(url); // String url =
jdbc:oracle:thin:oracleman/password@localhost:1521:XE (from config
file)
factory.setDataSource(ds);
_initiator = new SocketInitiator(
this,
factory,
settings,
new FileLogFactory(settings),
new DefaultMessageFactory());
Content of config file:
[DEFAULT]
FileStorePath=store
FileLogPath=log
StartTime=00:00:00
EndTime=00:00:00
ResetOnLogon=Y
HeartBtInt=30
ReconnectInterval=2
MaxReconnectAttempts=5
MaxWaitSeconds=300
Username=cargill_fixtc
Password=Starts123
JdbcTarget=oracle
JdbcHost=localhost
JdbcPort=1521
JdbcURL=jdbc:oracle:thin:oracleman/password@localhost:1521:XE
[SESSION]
SessionQualifier=webmqfa
UseDataDictionary=Y
DataDictionary=ICE-FIX44.xml
BeginString=FIX.4.4
ConnectionType=initiator
SocketConnectHost=localhost
SocketConnectPort=4242
SenderCompID=110
SenderSubID=1
TargetCompID=ICE
|