Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Process Manager (Stardust) » How to handle Exception in SQL invocation call application(How to handle Exception in SQL invocation call application)
How to handle Exception in SQL invocation call application [message #1714711] Mon, 16 November 2015 07:39 Go to next message
Ts Patil is currently offline Ts PatilFriend
Messages: 32
Registered: September 2015
Member
How to handle Exception in SQL invocation call application

I am calling a SQL invocation call which is failing so how can I handle it in my model . As when the SQL invocation fails my model is getting interrupted.

Also in their any way for converting model from interrupted state to Active.
Re: How to handle Exception in SQL invocation call application [message #1714715 is a reply to message #1714711] Mon, 16 November 2015 07:57 Go to previous messageGo to next message
Fradj Zayen is currently offline Fradj ZayenFriend
Messages: 6
Registered: October 2011
Location: Tunis, Tunisia
Junior Member
Hi,
you need to add onException block in your defaultCamelContext

<camelContext ...>
<onException>
<exception>java.lang.RuntimeException</exception>
<handled><constant>true</constant></handled>
</onException>
...
</camelContext>

This will prevent the current transaction to rollback.
then you can use event handler mechanism to catch the error at Process level.

Regards
Re: How to handle Exception in SQL invocation call application [message #1714751 is a reply to message #1714715] Mon, 16 November 2015 12:09 Go to previous messageGo to next message
Ts Patil is currently offline Ts PatilFriend
Messages: 32
Registered: September 2015
Member
Thanks for the reply.

Can you please provide detail example of it. whole camel which makes a SQL call throguh sql application . where the exception code needs to be added in that call. Please give a sample example or code
Re: How to handle Exception in SQL invocation call application [message #1715204 is a reply to message #1714751] Fri, 20 November 2015 09:09 Go to previous messageGo to next message
Ashish Khole is currently offline Ashish KholeFriend
Messages: 28
Registered: April 2015
Junior Member
Hi Patil,

Please find a attached sample model which shows how the error is handled. The model shows how the SQL Application Activity is aborted on error(e.g "org.springframework.jdbc.BadSqlGrammarException" caused due to use of invalid table name)and the error is handled.

You can refer below documentation how to add "Error Boundary Event"

http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.stardust.docs.analyst%2Fhtml%2Fhandbooks%2Fmodelling_analyst%2Fpep-events.htm&resultof=%22boundary%22%20%22boundari%22%20%22event%22%20

See section Error Boundary Event - Implementation

Best Regards,
Ashish

[Updated on: Fri, 20 November 2015 09:13]

Report message to a moderator

Re: How to handle Exception in SQL invocation call application [message #1715273 is a reply to message #1715204] Fri, 20 November 2015 17:48 Go to previous messageGo to next message
Ts Patil is currently offline Ts PatilFriend
Messages: 32
Registered: September 2015
Member
Thanks Ashish,

I understood your example. But you showing Error to user and If user completes the activity the process will end.

But I don't want the process should end. The person should contact administrator, once the admin fix the SQL issue the person should resubmit the data back to SQL... get success and go for next activity in process.
Re: How to handle Exception in SQL invocation call application [message #1715683 is a reply to message #1715273] Wed, 25 November 2015 09:11 Go to previous messageGo to next message
Ts Patil is currently offline Ts PatilFriend
Messages: 32
Registered: September 2015
Member
Any update on this?
Re: How to handle Exception in SQL invocation call application [message #1743623 is a reply to message #1715683] Sat, 17 September 2016 08:53 Go to previous messageGo to next message
Dev Khatri is currently offline Dev KhatriFriend
Messages: 2
Registered: September 2016
Junior Member
Dear Patil,

Facing the same issue. not able to receive data from database on next activity.

If you got solution kindly share a simple example which uses SQL Invocation.

Thanks.
dev.khatri@hotmail.com

Re: How to handle Exception in SQL invocation call application [message #1744370 is a reply to message #1743623] Mon, 26 September 2016 11:32 Go to previous messageGo to next message
Robert Emsbach is currently offline Robert EmsbachFriend
Messages: 186
Registered: October 2011
Location: Singapore
Senior Member

Any your requirement cannot be address by looping back into the original activity after the 'clearing' activity?
Re: How to handle Exception in SQL invocation call application [message #1744488 is a reply to message #1743623] Tue, 27 September 2016 12:11 Go to previous messageGo to next message
Dev Khatri is currently offline Dev KhatriFriend
Messages: 2
Registered: September 2016
Junior Member
I found solution for retrieve single row data from database in SQL invocation.
Can anybody suggest me how can I retrieve multiple rows

[Updated on: Tue, 27 September 2016 12:16]

Report message to a moderator

Re: How to handle Exception in SQL invocation call application [message #1744540 is a reply to message #1744488] Wed, 28 September 2016 04:54 Go to previous message
Ashish Khole is currently offline Ashish KholeFriend
Messages: 28
Registered: April 2015
Junior Member
Hello Dev,

Please refer the following documentation which explains the same:

http://help.eclipse.org/mars/topic/org.eclipse.stardust.docs.analyst/html/handbooks/modelling_analyst/applications/sql-application-overlay.htm

Regards,
Ashish
Previous Topic:Call stored procedure using Camel End Point Application
Next Topic:Portal problems on Neon.1
Goto Forum:
  


Current Time: Sun Sep 23 02:59:44 GMT 2018

Powered by FUDForum. Page generated in 0.02227 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top