Author |
Message
|
sachinramesh |
Posted: Thu Jun 26, 2008 11:33 pm Post subject: How do i commit the data when an exception occurs |
|
|
 Disciple
Joined: 20 Feb 2007 Posts: 170
|
HI
I had a flow which has an mqi/p ,compute and an mqo/p node.
I am trying to insert some records into a particular table ..
my problem is when i am tring to insert 5 records into the table i am getting an exception at the third record and i am not able to insert any of the records into the table
I want the first two records to get inserted into the table even if i get an exception at the 3rd record.
how do i do this?
i had tried setting the the transaction mode property in the compute node to COMMIT.But still none of the records are getting inserted
Is there any other property that i am missing out here.
i am working MB 5.0 on windows.. |
|
Back to top |
|
 |
Gaya3 |
Posted: Thu Jun 26, 2008 11:38 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
you can use a try catch node and perform the same or
you can perform commit for each trasaction with Data base. or
write good exceptional handling scenario for the same. _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
sachinramesh |
Posted: Fri Jun 27, 2008 1:09 am Post subject: |
|
|
 Disciple
Joined: 20 Feb 2007 Posts: 170
|
Gaya3 wrote: |
you can use a try catch node and perform the same or
you can perform commit for each trasaction with Data base. or
write good exceptional handling scenario for the same. |
How can i use commit statement in ESQL? |
|
Back to top |
|
 |
fschofer |
Posted: Fri Jun 27, 2008 2:25 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi,
simply
COMMIT;
but keep in mind that you are commiting all transactions including for example the message which started your flow.
Greetings
Frank |
|
Back to top |
|
 |
sachinramesh |
Posted: Fri Jun 27, 2008 2:38 am Post subject: |
|
|
 Disciple
Joined: 20 Feb 2007 Posts: 170
|
fschofer wrote: |
Hi,
simply
COMMIT;
but keep in mind that you are commiting all transactions including for example the message which started your flow.
Greetings
Frank |
Hi,
If i am saying simply COMMIT; in the esql code
i am getting a syntax error : Valid options include ::
the code is
WHILE (count <= record_count) DO
SET empno = InputBody.Records[count].eno;
SET empname = InputBody.Records[count].ename;
SET salmonth =InputBody.Records[count].month;
SET sal = InputBody.Records[count].salary;
INSERT INTO Database.sample(ENO,ENAME,MONTH,SALARY ) VALUES (empno,empname,salmonth,sal );
COMMIT;
set count = count + 1;
END WHILE;
RETURN TRUE;
END; |
|
Back to top |
|
 |
Gaya3 |
Posted: Fri Jun 27, 2008 3:14 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
use
passthru('commit') _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
sachinramesh |
Posted: Fri Jun 27, 2008 3:27 am Post subject: |
|
|
 Disciple
Joined: 20 Feb 2007 Posts: 170
|
Gaya3 wrote: |
use
passthru('commit') |
Thanks Gayatri and fschofer
its working fine now. |
|
Back to top |
|
 |
|