Hi there,
I have to read a xml file and import the values into a database (mssql server 2000). I'm using dom4J for iterating over the xml nodes and after that I create a new database object using the following command:
TblImportAlert alert = (TblImportAlert)context.createAndRegisterNewObject(TblImportAlert.class);
//setting the values and references to other tables
...
context.commitChanges();
Nothing special on it excepting that I set the values in an extra method that gets the alert object as parameter. But I always get an commit exception without any further information.
org.objectstyle.cayenne.CayenneRuntimeException: [v.1.2M4 May 7 2005] Commit Exception
at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1052)
at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1013)
....
Caused by: java.lang.AbstractMethodError: com.microsoft.jdbc.sqlserver.SQLServerConnection.prepareStatement(Ljava/lang/String;I)Ljava/sql/PreparedStatement;
at org.objectstyle.cayenne.conn.ConnectionWrapper.prepareStatement(ConnectionWrapper.java:477)
at org.objectstyle.cayenne.access.jdbc.BatchAction.runAsIndividualQueries(BatchAction.java:219)
at org.objectstyle.cayenne.access.jdbc.BatchAction.performAction(BatchAction.java:126)
at org.objectstyle.cayenne.access.DataNode.runBatchUpdate(DataNode.java:398)
at org.objectstyle.cayenne.dba.sqlserver.SQLServerDataNode.runBatchUpdate(SQLServerDataNode.java:137)
at org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:319)
at org.objectstyle.cayenne.access.DataContextCommitAction.commit(DataContextCommitAction.java:187)
at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1043)
...
In the log file I see the following entry :
org.objectstyle.cayenne.access.QueryLogger.INSERT INTO dbo.tblImportAlert (alertDate, efficiencyBlockNumber, errorCode, gakSerialNumber, invertorSerialNumber, loggerId, receiveDate, status, stringNumber, valueList) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
I think, that the bind values are missing !? In the debugger the values of the alert seems to be correct. I'm using cayenne 1.2 M4 but tried it also with M8 + M9. Here's the output of the toString() method:
{[ efficiencyBlockNumber => 1
alertDate => Thu Dec 01 14:15:00 CET 2005
receiveDate => Wed Jan 04 17:45:58 CET 2006
tblNotificationMessageArray => org.objectstyle.cayenne.Fault$ToManyFaul..337d3
toTblLogger => {<oid: sr2.back.gen.TblLogger: <loggerId: 339>; state: modified>}
valueList => "inverter-alarm"
toTblStatus => {<oid: sr2.back.gen.TblStatus: <status: ins>; state: modified>}
gakSerialNumber =>
errorCode => 15
invertorSerialNumber =>
]<oid: sr2.back.gen.TblImportAlert (temp): ; state: new>}
Lothar
P.S.: Sorry about all the questions but for now I'm on my own so I can't ask someone other ;(
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
This archive was generated by hypermail 2.0.0 : Wed Jan 04 2006 - 11:53:31 EST