Exception Handling - aqualogic.bpm.modeling(Archived)

Once an exception occurs in a process it is stored in a Exception Holder variable (instance variable). I am using a transition with a <b>Others</b> exception. What data type I must to use in the exception holder? I need display the trace information so, I can't use <b>Any</b> data type.<br><br>
Thank you, 

You cannot use an exception type for the Others exception catcher, it should be "Any".
If you create an exception transition of "Java.Lang.Exception" or any subclass, you should be able to create a variable of the same type and use it properly.


Unable to get exception detail in CatchAll fault

I have attached Catch all activity to my process. Inside process calling database procedure that throws no data found exception. I want to capture in catchAll fault.
I tried ora:getFaultAsString and ora:getFultName xpath function.
But first one result whole exception as node string. so can not se real exception message.
second one generates exception can not parse xpath query FOTY0001.
I tried to do expression ora:getFaultName() to simple type variable of QName.
My requirement is just get exception whatever my process is throwing in catchall block.
Any suggestion?

How to Handel the Internal Exceptions

Hi All,
Im newbie to Top Link. I have created few constraints on table like "not null", When I persist the object Toplink throws only an exception like
"Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException"
and an Internal Exception like
"Internal Exception: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'password' cannot be null"
I want to throw a my own meaningful exception like "PasswordNullException". So is there any way to catch the toplink exception with which column cause the problem. In this cause I want to catch "IntegrityConstraintViolationException" as the Exception and "password" as the column.
Wrapping the commit/flush call and translating the exception is the only thing to do. If the database just gives us the string message describing the failure you will have to parse the column information from the message.
Thank you very much for the reply... I was also thinking such solution. But I wanted to know is there any straightforward method to overcome this problem.. So I think the only way is writing OracleExeptionParser..
Thank you again

DateTime Format issue

Hi All,
I have an application developed in SOA The SOA application receives live feed from third party and stores into database.
The problem is the third party feed contains datetime field value as '2011-04-29T13:25:30.0000000+10:00' which the DB adapter does not seem to like. The String value looks as per the expected iso 8601 xs:dateTime format.
Please suggest what to do? The error details are as below.
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [ODS_EVENT.OdsEvent]. Caused by Exception [EclipseLink-3001] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.ConversionException Exception Description: The object [2011-04-29T13:25:30.0000000+10:00], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp]. Internal Exception: BINDING.JCA-11636 Could Not Convert Timestamp Exception. Unable to convert a string value in the xml to a java.sql.Timestamp. Even though databases accept strings representing timestamps in a variety of formats, the adapter only accepts strings representing them in xml ISO dateTime format. The input value must be in *iso 8601 xs:dateTime format*, i.e. *YYYY-MM-DDTHH:MM:SS.sss-07:00* . Please see the logs
In Oracle use this statement to convert to a valid date .
TO_TIMESTAMP(replace(msgdatetime,'T',' '),'YYYY-MM-DD HH24:MI:SS.FF3')
Hope it helps
Before invoking the DB adapter use a XSLT to convert the date format. There are lots of functions in XSLT which can let you do this like
+<xsl:value-of select='xp20:format-dateTime(InputDate,"[Y0001]-[M01]-[D01]")'/>+
In case none of them, try converting using a java embedding node or manipulating the date like a string in XSL.
I agree with AR.
For reference see this thread : http://forums.oracle.com/forums/thread.jspa?messageID=2231955

Array Binding and DB Triggers

Hello all,
we have a table with an after-insert-trigger, where some bussiness rules are checked.
We try to insert into this table from .Net using the ODP.Nets's feature 'array bind'.
Problem: If there are more rows violating the bussiness rules, the OracleException which is thrown contains only one OracleError, the mesasge is right(containing the exception issued by the trigger) but its ArrayBindIndex is wrongly = 0.
We were expecting more OracleErrors with the right ArrayBindIndex to identify the rows which failed.
Can anyone explain this behaviour? Is array binding error handling not supposed to work with user defined exceptions?
Thanks for any hint,

UnitOfWork synchronization bug?

We're using UnitOfWork in our web application(OC4J 9.0.2 with the latest Toplink release
In a "save" request, we register three different type of objects(three tables) in a uow.
Then we do a jmeter test with 10 the same "save" requests simultaniously. What the "save" does is two things:
(1) Do a query to retrieve a sequency Id
(2) Set the id to the first record and save the three records using UOW with the first record using id as the optimisticLock field.
The result:
2 successful saves,
1 error save ( saved the three correct objects and one extra from a different request)
The other 7, we got optimisticLockException and didn't save anything except one saved partially (which caused the error save mentioned above).
When we use ExternalTransactionController, we got "ValidationException" instead of OptimisticLockException. Other than that, it failed in a similar manner as the Toplink transaction controller did.
Is this a synchronization bug in our code or Toplink?
Anybody has similar experience or just my buggy code?
Hello Wei,
I'm not sure I understand your test case. You mention you change the id in the test? Are you changing the pk of an object in a UOW? If so, bad things will happen. Also, you are setting the version number of an object explicitly? If you use the version opt locking policy in TopLink, it can increment this for you. Also, can you elaborate a bit more on the validation exception?
- Don
Here is my test:
In the "save", I save three records:
ARecord, BRecord, CRecord (Each has its own table)
and I also update a SequenceNumber record.
ARecord has a sequence number field and I uses "useChangedFieldsLocking" for optimistic locking for updating SequenceNumber object.
Here is the steps I do to "Save":
(1) get a client session and do a query on my sequence table to retrieve a sequence number in a SequencyNumber object
(2) Set the sequence id to ARecord
(3) Set some id related fields in BRecord,CRecord
(4) Register ARecord, BRecord and CRecord to a UOW
(5) Register the SequenceNumber I retrieved in Step (1) to UOW
(6) Increase the sequence in the SequenceNumber object
(7) commit
The optimistic locking works "all the time" if I use a single thread test.
In multiple thread condition, it works some times. When if failed, my result becomes:
for a ARecord here are the related saves:
ARecord, BRecord, BRecord, CRecord, CRecord
Some times I got three duplicates.
"Are you changing the pk of an object in a UOW?"
I don't think I changed the SequenceNumber object's pk.
I only changed one field value in my sequence table (not a key)
For the new objects, I do set their keys.
When I change my session to use External transaction controller:
serverSession.setExternalTransactionController(new Oracle9iJTSExternalTransactionController());
instead of getting a optimistic locking exception, I got this instead:
EXCEPTION [TOPLINK-7061] (TopLink - (Build 430)): oracle.toplink.exceptions.ValidationException
EXCEPTION DESCRIPTION: Exception occurred within JTS.
INTERNAL EXCEPTION: javax.transaction.RollbackException
at oracle.toplink.exceptions.ValidationException.jtsExceptionRaised(Unknown Source)
at oracle.toplink.jts.JTSExternalTransactionController.commitTransaction(Unknown Source)
at oracle.toplink.publicinterface.Session.commitExternalTransaction(Unknown Source)
at oracle.toplink.publicinterface.UnitOfWork.commitInternallyStartedExternalTransaction(Unknown Source)
at oracle.toplink.publicinterface.UnitOfWork.commit(Unknown Source)
at icis.qci.db.QciInsert.insertToDB(QciInsert.java:50)
at icis.qci.common.CommonHttpHelper.commitFormJava(CommonHttpHelper.java:184)
at icis.qci.docket.QciDocketAction.executeProcess(QciDocketAction.java:97)
at icis.common.action.BaseCaseProcessAction.execute(BaseCaseProcessAction.java:84)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:506)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:684)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
Thanks for you help.
"(1) get a client session and do a query on my sequence table to retrieve a sequence number in a SequencyNumber object"
Can you elaborate on this? Are you using TopLink native sequencing or TopLink table based sequencing? It sounds like you're using your own sequencing strategy, and perhaps that's where they problem is happening -- in a concurrent situation you're somehow getting multiples of the same sequence number...
I think I found part of the problem. When we do a JMeter testing, JMeter keeps its own session which somehow out of synch and added the records to the next test case loop or test thread. I think I can handle it from here now.
Another problem we are having is the "External Controller". When we use the "external transaction controller", we don't get a optimisticLockException, instead, we got the "ValidationException". Is there something wrong?
Thanks again for you help.
I believe that the ValidationException is thrown when an error occurs during the JTS commit, it should have the OptimisticLockException as it internalException.
Hi James,
We were doing the same jmeter test using External/Internal transaction controller. I don't understand why in one case it throws OptimistiLockException and in the other case ValidationException. And it's very consistant.
Could it be Toplink generated some sql that is not proper under external controller?
What is the validation error message?
When JTS is used the commit will occur very differently. With TopLink controlling transactions when you commit the unit of work it will commit to the database and throw any exception that occurs direction. With JTS TopLink will wait for the JTS driver to tell it to commit, any error will be thrown to the JTS driver which will then return the error to the application.
ValidationException is thrown when an error occurs during the JTS commit, it should have the OptimisticLockException as its internalException. 
What I did was just switching the control from internal to external. This shouldn't changed any thing in my code.
The error message was post in a previous message and the exception is:
This is not an jdbc driver exception. It looks like Toplink originated this exception.
Thanks for you help.