Problem with esbdb

Posted by Admin on 13-Oct-2008 23:24

Hi all,

I am trying to run multiple SQL Statements in a single esbdb file and some of the multiple statements are coded to take input parameters from the input xml file.

When I run, I always face this error.


Caused by: com.sonicsw.esb.service.rdbms.script.DatabaseScriptEngineException: Failed to execute prepared statement: 'insert into `transaction` values(0,?,'CREDIT',?,'2008-10-13');insert into `transaction` values(0,?,'DEBIT',?,'2008-10-13');update account set acc_debit=acc_debit? where acc_id = ?;update account set acc_credit=acc_credit? where acc_id = ?;



I am certain that the XPath mapping I am using is correct as the same statements run perfectly fine when I run them individually; it's only when I try to run the statements in bunch that such error appears.

The ? seems to appear in place of the mapped parameter.

I am using Sonic V7.6 and MySQL database.


All Replies

Posted by Admin on 20-Oct-2008 02:02

My question seems too vague,

Let me make it more clear,

I am dealing with MS SQL Server 2005 database,

When I try to run commit or rollback statement alone using an esbdb file, I run into the error mentioned above



Caused by: com.sonicsw.esb.service.rdbms.script.DatabaseScriptEngineException: Failed to execute prepared statement: 'rollback;



I guess this is because SQL Server requires begin transaction and rollback with the same session connection, When I run rollback alone the earlier begin transaction statements have nothing to do with this rollback statement.

But when I try to have more than one statement within the same esbdb file, I run into the error I mentioned above,

Any help in the matter would be appreciable,

Thank you

Posted by Admin on 04-Nov-2008 14:57

Is it possible to see the entire esbdb file you are using?

Posted by Admin on 04-Nov-2008 22:12

Hi Mark,

Thanks for your interest,

I have attached the images and corresponding to the esbdb process file herewith,

The problem is that the process is unable to map the input parameters (though while debugging the esb variables seem to contain the values). The question marks appear in place of the actual values.

The extended error message is ::

com.sonicsw.esb.service.rdbms.DatabaseServiceException: Service call failed.

at com.sonicsw.esb.service.rdbms.DatabaseService.serviceConnection(

at com.sonicsw.esb.service.rdbms.DatabaseService.service(

at com.sonicsw.xqimpl.service.debug.DebugServiceInterceptor.intercept(

at com.sonicsw.xqimpl.service.XQServiceChain$XQInterceptorServiceWrapper.intercept(

at com.sonicsw.xqimpl.service.XQServiceChain$XQInterceptorServiceWrapper.service(

at com.sonicsw.xqimpl.service.XQServiceChain.service(

at com.sonicsw.xqimpl.service.ServiceMessageHandler.callService(

at com.sonicsw.xqimpl.service.ServiceMessageHandler.handleMessage(

at com.sonicsw.xqimpl.service.ProcessMessageHandler.doHandleMessage(

at com.sonicsw.xqimpl.service.ProcessMessageHandler.handleMessage(

at com.sonicsw.xqimpl.service.XQDispatcher.onMessage(

at com.sonicsw.xqimpl.endpoint.container.EndpointContextContainer.onMessage(

at com.sonicsw.xq.connector.jms.JMSEndpoint$JMSEndpointListener.onMessage(

at progress.message.jimpl.Session.deliver(


at progress.message.jimpl.Session$

Caused by: com.sonicsw.esb.service.rdbms.script.DatabaseScriptEngineException: Failed to execute prepared statement: 'insert into `transaction` values(0,?,'DEBIT',?,concat(concat(curdate(), ' '),curtime()));


at com.sonicsw.esb.service.rdbms.script.DatabaseScriptCommand.executePreparedStatement(

at com.sonicsw.esb.service.rdbms.script.DatabaseScriptCommand.execute(

at com.sonicsw.xqimpl.script.Command.executeScriptCommand(

at com.sonicsw.xqimpl.script.Command.execute(

at com.sonicsw.xqimpl.script.ScriptEngine.executeCommand(

at com.sonicsw.esb.service.rdbms.DatabaseService.serviceConnection(

... 15 more

Thank you.

Posted by Admin on 06-Jul-2010 09:48

I have trouble processing the esbdb, here are the details.

I use MS SQL 2008

My SQL is as follows.

select * from tableName
where FieldName = SUBSTRING(CONVERT(VARCHAR(10),  @VariableName, 120), 1, 10);

The value I supplied is.

VariableName = '2010-05-17 14:21:42.000-05:00'


Swaroop Kunduru.

Posted by jerem on 08-Jul-2010 04:50

hello all!

Try to remove ";" at the end of your statements.


Chan Jeremy

This thread is closed