Jul 9, 2009

Working with DB Adapter Polling Settings

DB polling will poll the records from the source database. Polling can be done in different strategies like physical delete, logical delete etc. I am not going to explain about the polling strategies here. Instead I just want to have a quick glance at the various settings available for the polling options.
Through polling frequency one can set the time duration between successive polls in seconds.
“Database rows per xml” is the maximum number of payloads per BPEL instance. For ex: If it set as ‘1’ then for every record there will be a BPEL instance. If it set as ‘10’ then for every 10 record there will be one BPEL instance
“Database rows per transaction” sets the number of records polled per transaction.
“Order by” will choose order the records in ascending order.
“Delay commit” This will delay the deletion of all rows until all have been read.

“Distributed Polling” will be used during the clustered environments. This will avoid the creation of multiple instances of BPEL. Means it will avoid the possibility of picking the same record multiple times in a clustered environment.
“Use batch destroy” Use this to delete all rows at once after they have been read.
Scenario: Select the records one by one ordered by some field from the source database in a clustered environment.
For the above scenario we can try setting “Database rows per transaction” as ‘1’ and set the distributed polling. That will create the SQL query as shown below

But if you check the SQL query carefully this will select the first record and then does the order by , which is of no use J . That won’t help in our scenario. I think that’s the bug in the tool. So using this option we can’t achieve our scenario. For achieving that we can use the “clusterGroupID” property in bpel.xml