I tracked down the cause of the ALDSP exception mentioned in yesterday's
entry. The stacktrace is exhibited below. It is caused by specifying
setting the 'auto number' property of a data service key to 'sequence' for
anything other than Oracle or DB2. In my case, I was using MS SQL Server
but had accidentally selected 'sequence' instead of 'identity'. Looking at
the code for JDBCAdaptor.populateSequence
, I saw that it calls
SQLGenerator.getSQLSequenceFetch
to generate an SQL statement to
get the next sequence value. The latter returns null for any database type
other than Oracle or DB2. The caller then tries to execute 'null' as the
SQL statement which the JDBC driver catches as an error. I suppose that
one of the routines involved should have caught the mistake and thrown a more
informative error message.
Here is the stacktrace:
[SQLServer JDBC Driver]Invalid SQL specified.
com.bea.ld.dsmediator.DataServiceException: java.sql.SQLException: [BEA][SQLServer JDBC Driver]Invalid SQL specified.
at com.bea.ld.dsmediator.update.JDBCAdaptor.save(JDBCAdaptor.java:248)
at com.bea.ld.dsmediator.update.DataServiceMediator.submit(DataServiceMediator.java:500)
at com.bea.ld.dsmediator.update.DataServiceMediator.nestedSubmit(DataServiceMediator.java:1871)
at com.bea.ld.dsmediator.update.DataServiceMediator.executeUpdatePlan(DataServiceMediator.java:1828)
at com.bea.ld.dsmediator.update.DataServiceMediator.submit(DataServiceMediator.java:511)
at com.bea.ld.dsmediator.update.DataServiceMediator.submit(DataServiceMediator.java:227)
at com.bea.ld.ServerBean.submit(ServerBean.java:529)
at com.bea.ld.Server_ydm4ie_EOImpl.submit(Server_ydm4ie_EOImpl.java:856)
at com.bea.ld.Server_ydm4ie_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:492)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:435)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:430)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
Caused by: java.sql.SQLException: [BEA][SQLServer JDBC Driver]Invalid SQL specified.
at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
at weblogic.jdbc.base.BaseStatement.commonValidateSQL(Unknown Source)
at weblogic.jdbc.base.BaseStatement.execute(Unknown Source)
at weblogic.jdbcx.base.BaseStatementWrapper.execute(Unknown Source)
at weblogic.jdbc.wrapper.Statement.execute(Statement.java:386)
at com.bea.ld.dsmediator.update.JDBCAdaptor.populateSequence(JDBCAdaptor.java:328)
at com.bea.ld.dsmediator.update.JDBCAdaptor.save(JDBCAdaptor.java:113)
... 17 more