Issue with Transaction Control

Hi,

I have created one Batch Insert Adapter Service .The Connection used is of LOCAL_TRANSACTION type.

First 10 records of the Input are valid data ,11th record contains some invalid data then the rest records are valid.

When am running the adapter service by giving input it gives the error Invalid data(As expected) and no record is getting inserted.

When i am calling the Adapter service in a flow service and executing the flow service the first 10 valid records are getting inserted as well as getting the error saying invalid data(as 11th record is invalid).

I have not used startTransaction ,commitTransaction,rollBackTransaction.

Regards
Sitikantha

Hi Sitikantha,

can you please tell what are the datatypes you have used and a sample data for the 1st record and the 11th record.

Thanks in Advance
Gouse.

Hi Gouse,

  Thanx for ur reply.

But may i know how is the Datatype of the Record related to the issue.

I cant understand what is the Datatype of the Record.As per my understanding The record will be having number of fields and the field can have a datatype.Do u mean to ask the datatype of the fields??

FYI… the Data Type of the 1st Record and 11th record will be same(from webmethods prospective) as the input is a Doclist where each record is a document.

Hope i answered ur question…

Regards
Sitikantha

Hi Sitikantha,

yes the datatype for 1st and 11th record will be same , let me know what is value(data) you have entered for the 1st record and 11th record as you have said the 11th record contains some invalid data as there will be a difference with jdbc Data type to java Data type mappings with the data you have entered.

Thanks in Advance
Gouse.

Can you give us a screen shot at what step it is failing and the 11th record data (values) that you are trying to insert??

It could be a data issue or spl char issue which jdbc insert service cannot handle for that JDBC datatype…

HTH,
RMG

Hi RMG and Gouse,

  Thnks for the reply.

But i am giving the 11th record invalid intentionaly.
For example giving null value for the Primary key(not null).

But my question is if am running the Adapter Service(Batch Insert)
it thows the error(As expected) without inserting any record but when am invoking this Adapter service in a flow service and running the flow service why the valid records are getting inserted.

Regards
Sitikantha

Hi Sitikantha,

you are giving null value for the primary key,

as you know the primary key constraint doesn’t accepts null and it should be unique

so if you are running the Adapter service BatchInsertSql you should enter mandatory fields that are required. you can get exception when you are entering null value or duplicate value which already exists either from 1 to 10 records for the column which Primary key constraint already set.

you can get error If you are running individual flow service(InserSql service)when you do not ener mandatory fields that are set when creating Table.

[COLOR=red][B]

[/b][/color]

here i think you have entered valid records which satisfies the constraints that has set.

If you want to look at the exception by running the flow service individually then enter the duplicte/null value for the column where primary key constraint has been set

[COLOR=red]
Thanks
Gouse.

[/COLOR]

The problem could be the way you have your flow service for
start,commit,rollback transaction services sequence.Is your Try-Catch flow like this??

startTrasaction($transactionName)
Sequence(Success)–Try
---->Sequence(Failure)
----->Your mapping
----->BatchInsert service
----->commitTransaction($transactionName)
---->Sequence(Done)–Catch
------>getLastError(error)
------>rollbackTransaction($transactionName)

HTH,
RMG