Hello,
I'm trying to use Sequoia on a java application with spring-hibernate and
Ms Sql Server (with jtds driver).
I have 2 controller nodes with 2 virtual databases. I have resolved many
problems (i have made changes in MssqlBackuper for backup and restore
functions). But i still have problem with a stored procedure : it works
well with a direct jtds connection, but not with sequoia driver (exception
thrown).
I don't know where is the problem and how to resolve this, maybe in my
DatabaseSchema config ?
(I'm using sequoia 2.10.9)
any idea ?
Thanks
Christophe
here's the exception
------------------------------
2007-08-08 12:06:22,177 DEBUG org.hibernate.util.JDBCExceptionReporter:
could not execute native bulk manipulation query [MC_VALIDER_VERSION 323]
org.continuent.sequoia.common.exceptions.driver.DriverSQLException:
Message of cause: SQL statement does not match a query returning an update
count (MC_VALIDER_VERSION 323)
at
org.continuent.sequoia.driver.Connection.statementExecuteUpdate(Connection.java:2907)
at
org.continuent.sequoia.driver.Statement.executeUpdateWithSkeleton(Statement.java:584)
at
org.continuent.sequoia.driver.PreparedStatement.executeUpdate(PreparedStatement.java:183)
at
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
at
org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:165)
at
org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1163)
at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:334)
here's my vdb config
-----------------------------------------------
<DatabaseBackend name="mci-srv2" driver="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://10.205.100.94;DATABASENAME=MCI_CRO"
connectionTestStatement="select type from master.dbo.syscharsets">
<DatabaseSchema schemaName="dbo" dynamicPrecision="all">
<DefaultStoredProcedureSemantic hasDDL="false"/>
</DatabaseSchema>
<ConnectionManager vLogin="**" rLogin="**" rPassword="**">
<VariablePoolConnectionManager initPoolSize="10" minPoolSize="5"
maxPoolSize="50" idleTimeout="30" waitTimeout="10"/>
</ConnectionManager>
</DatabaseBackend>
here's my stored procedure
---------------------------------
CREATE PROCEDURE dbo.MC_VALIDER_VERSION (
@MC_ID int
)
AS
BEGIN
-- calcule le n° de version
DECLARE @MC_VERSION int
SELECT @MC_VERSION = COALESCE(MAX(MC_VERSION),0)+1 FROM MC_RACINE WHERE
MC_ID = @MC_ID AND MC_VERSION>0;
DECLARE @sql nvarchar(4000)
DECLARE @TABLE nvarchar(40)
DECLARE C CURSOR FAST_FORWARD FOR
SELECT "TABLE" FROM dbo.MC_ORDRE_TABLES() ORDER BY ORDRE
OPEN C
FETCH NEXT FROM C INTO @TABLE
WHILE @@fetch_status = 0
BEGIN
DECLARE @colonnes nvarchar(500)
SET @colonnes = dbo.TABLE_LISTER_COLONNES(@table,'[MC_ID][MC_VERSION]')
SET @sql = 'INSERT INTO ' + @table
+ ' (MC_ID,MC_VERSION,' + @colonnes + ')'
+ ' SELECT ' + STR(@MC_ID) + ',' + STR(@MC_VERSION) + ',' + @colonnes +
+ ' FROM ' + @table + ' WHERE MC_ID=' + STR(@MC_ID) + ' AND
MC_VERSION=0';
execute(@sql);
FETCH NEXT FROM C INTO @TABLE
END
CLOSE C
DEALLOCATE C
END
_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia