DB Adapter Polling for Delete

Hi,
I want to poll the Database table for delete.
If there is delete event on table I want to capture that record.
if anyone has idea, how to achieve this with DbAdapter Polling.
Thanks,
Arun Jadhav.

Hi,
there are 2 ways of using db polling on table.
1. Physical delete: where you delete the record after reading the record from the table.
2. Logical Delete: where you logically disable the record from polling after its read once. In logical delete, you actually need to take a read_flag column and update the flag value once that record is read. Say, you insert the new record--its initial read flag value will be N and after its read you update the read flag value to Y so that the same record is not read again.
Let me know if your query is answered.
Regards,
Gautham

Similar Messages

  • DB Adapter: Polling For New Records returns the First record multiple Times

    I Polling for New or Chnaged Records against DB2 on iSeries. The DB Adapter returns the first record from the Table multiple Times. If the Table has 5 records it displays the first record 5 times. I am using BPEL 10.1.3.1 Can anyone help me with this.

    Hi there,
    please check out the DBAdapter trouble-shooting guide:
    http://download-east.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/app_trblshoot.htm#CIHFEHFA
    I am copying an entry from there into here:
    A.1.21 Some Queried Rows Appear Twice or Not at All in the Query Result
    Problem
    When you execute a query, you may get the correct number of rows, but some rows appear multiple times and others do not appear at all.
    This behavior is typically because the primary key is configured incorrectly. If the database adapter reads two different rows that it thinks are the same (for example, the same primary key), then it writes both rows into the same instance and the first row's values are overwritten by the second row's values.
    Solution
    Open Application Sources > TopLink > TopLink Mappings. In the Structure window, double-click PHONES. On the first page, you should see Primary Keys. Make sure that the correct columns are selected to make a unique constraint.
    Save and then edit the database partner link.
    Click Next to the end, and then click Finish and Close.
    Open your toplink_mappings.xml file. For the PHONES descriptor, you should see something like this:
    <primary-key-fields>
    <field>PHONES.ID1</field>
    <field>PHONES.ID2</field>
    </primary-key-fields>
    Thanks
    Steve

  • DB Adapter polling : Not deleting the read records

    Hi,
    I have a simple BPEL process to poll a database table to delete records after reading them.I tried testing by inserting a single record into the table.BPEL is simply creating new instance (as it is not deleting the read records).
    I am using fusion middleware version 11.1.1.3.0.
    Also i am not able to view flow trace.I see a row under flow trace but there is no link to open audit trail or flow page.How to enable this.
    thanks,
    ashok

    Hi Naresh,
    Here is the contents of jca file:
    <adapter-config name="readDB" adapter="Database Adapter" wsdlLocation="readDB.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/DB/ArbonneProd" UIConnectionName="ArbonneProd" adapterRef=""/>
    <endpoint-activation portType="readDB_ptt" operation="receive">
    <activation-spec className="oracle.tip.adapter.db.DBActivationSpec">
    <property name="DescriptorName" value="readDB.CustomersToOracle"/>
    <property name="QueryName" value="readDBSelect"/>
    <property name="MappingsMetaDataURL" value="readDB-or-mappings.xml"/>
    <property name="PollingStrategy" value="DeletePollingStrategy"/>
    <property name="PollingInterval" value="10"/>
    <property name="MaxRaiseSize" value="1"/>
    <property name="MaxTransactionSize" value="10"/>
    <property name="NumberOfThreads" value="1"/>
    <property name="ReturnSingleResultSet" value="false"/>
    </activation-spec>
    </endpoint-activation>
    </adapter-config>
    Under trace i see below record:
    Instance Type Usage State
    ReadDB of service:<instanceid> JCA Adapter Service Completed

  • How to specify custom SQL in polling db adapter with logical delete option

    Hi all,
    I am writing a SOA composite app using JDeveloper SOA Suite 11.1.1.4 connecting to a SQL Server db using a polling DB Adapter with the logical delete option to send data to a BPEL process.
    I have requirements which go beyond what is supported in the JDeveloper UI for DB Adapter polling options, namely:
    * update more than one column to mark each row read, and
    * specify different SQL for the logical delete operation based on whether bpel processing of the data polled was successful or not.
    A complicating factor is that the polling involves two tables. Here is my full use-case:
    1) Polling will select data derived from two tables: e.g. 'headers' and 'details' simplified for this example:
    table: headers
    hid - primary key
    name - data label
    status - 'unprocessed', 'processed', or 'error'
    processedDate - null when data is loaded, set to current datetime when row is processed
    table: details
    hid - foreign key pointed at header.hid
    attr - data attribute name
    value - value of data attribute
    2) There is a many:1 relationship between detail and header rows through the hid columns. The db adapter polling SELECT shall return results from an outer join consisting of one header row and the associated detail rows where header.status = 'unprocessed' and header.hid = details.hid. (This is supported by the Jdeveloper UI)
    3) The polled data will be sent to be processed by a bpel process:
    3.1) If the bpel processing succeeds, the logical delete (UPDATE) operation shall set header.status = 'processed', and header.processedDate = 'getdate()'.
    3.2) If bpel processing fails (e.g. hits a data error while processing the selected data) the logical delete (UPDATE) operation shall set header.status = 'failed', header.processedDate = 'getdate()', and header.errorMsg = '{some text returned from bpel}'.
    Several parts of #3 are not supported by the JDeveloper UI: updating multiple columns to mark the row processed, using getdate() to populate a value of one of those column updates, doing different update operations based on the results of the BPEL processing of the data (success or error), and using data obtained from BPEL processing as a value of those column updates (error message).
    I have found examples which describe specifying custom SQL using the polling delete option to create a template then modifying the toplink file(s) to specify custom select and update SQL to implement a logical delete. (e.g. http://dlimiter.wordpress.com/2009/11/05/advanced-logic-in-oracle-bpel-polling-database-adapter/ and http://myexperienceswithsoa.blogspot.com/2010/06/db-adapter-polling-tricks.html). But none of them match what I've got in my project, in the first case because maybe because I'm using a higher version of JDeveloper, and in the second I think because in my case two tables are involved.
    Any suggestions would be appreciated. Thanks, John

    Hi John,
    You've raised a good scenario.
    First of all let me say that the purpose of the DB polling transaction, is to have an option to initiate a process from a DB table/view and not to update multiple fields in a table (or have other complex manipulation on the table).
    So, when choose to update a field in a record, after reading it, you are "telling" the engine not to poll this record again. Sure, i guess you can find a solution/workaround for it, but I don't think this is the way....
    The question now is what to do?
    You can have another DB adapter where you can update the data after finishing the process. In that case, after reading the data (on polling transaction) - update the header.status = 'processed' for example, and after processing the selected data update the rest of the fields.
    Hope it make some sense to you.
    Arik

  • File Adapter going into infinite mode while polling for the file

    Hi,
    I am facing an issue while the file adapter is reading the data from the file.
    If the file from which it is reading has been deleted it keeps on polling for it infinite number of times and also doesn't pops out with any error message. Is there any method that after polling for some time period we can pop out a message that the particular file is not available and then the file adapter should stop polling for the file.Anyone has some ideas about this. Any pointers will be of great help.
    Thanks
    Vinay
    Message was edited by:
    soachd

    Hi soachd,
    As far as I understand polling is infinite process. You need to adopt this strategy if you are expecting some thing to happen all the time or may be when you want to be ready when ever an expected event happens. This provides a real time solution but with the downside of infinite execution.
    Hope it helps.
    Kalyan.

  • DB Adapter infinite polling for the db

    Hi all Oracles
    I am facing a mazing pb. A BS publish all what is in the DB but, sometime with a duplication,X3,X4,, and so one)
    Any idea

    Hi,
    Thank's for the reply, so:
    1)DbAdapter:
    -Exposed service
    -Poll for new changes
    -Delete field
    -Other options: by default
    2)Proxy
    -From the DB adapter
    -purge the db, and delete fields
    -publish into a BS
    -log the field when it's written in the queue
    3)BS
    -Write straightforward all the outbounds in the queue.
    Thanks

  • File adapter, trigger if no file is polled for pre-defined time

    Hi',
    I am polling for a file in a directory, my requirement is to notify by a email
    if no file is polled for 1 hour or so, i.e. if no file comes in that directory for
    long time.
    Is there a way we can achieve this, I tried using a pick activity instead of
    receive, however it does not allow on-alarm in this condition.
    Please advice.
    Thanks
    Yatan

    If you dont want to use database then you can do with your files as well, if at all you are archieving the files.
    Say as soon as i get the files in the folder the adapter will read its content and then move it to archive folder, then you can have a logic to list the file and get the timestamp of the latest file from archive and compare with current time stamp and that will trigger a mail.
    You can achive the above using API.
    Thanks,
    Vijay

  • Sender SFTP Adapter channel is not polling for files

    Hello All,
    Couple of SFTP sender adapter channel was failing in Developent system with u201Cdirectory listingu201D error.All SFTP sender channels stopped polling for the files in Developent system  . We were unable to find the reason for adapter failure, Hence we restarted the j2ee server and adapter started polling files. Later we are facing the same issue in Quality system. THe adapter cahnnel is not polling files in Quality system even.
    All lean tool adapters were showing the u201CHost key was not accepted erroru201D on 27th of Feb . As per the other channel trace, the time stamp of last successful polling and error time stamp of lean tool sender channels are exactly same
    Eventhough two communication channels access the same SFTP adapter, one communicationchannel is getting 'Host key was not accepted error' but in other communication channel, files are getting picked.
    Please let me know the solution if you have come accross this issue previously
    Regards,
    DilipKumar

    Hi Mike,
    Thanks for your reply.
    Its not a standard SFTP adapter rather its a C-BURGER SFTP adapter.
    Sorry I did not mention this in my previous post
    Regards,
    DilipKumar

  • Need Help-SOA 11g File Adapter unable to delete input file and its crashing

    Hi All
    Please find the details below:
    1. We have created a simple SOA composite to Read file from an input directory, archive the file in an archive directory using Inbound File Adapter Read
    and then use Outbound File Adapter Write to move the file to a output directory.
    2. File Adapter needs to delete the file after successful read/retrieval.
    3. We are using the "Use Trigger File" for invoking the file adapter. This is a new feature in SOA 11g
    4. Also we are using the option of reading the file as an attachment as we are not doing any transformation in the composite
    Issue Details_
    1. When the trigger file is put in the input directory for the first time, the File Adapter reads the file, archives it and moves it to the output directory
    2. However it does not delete the input file from the input directory and raises Fatal Exception mentioned below:
    [*2011-01-12T16:55:48.639+05:30] [soa_server1] [WARNING] [] [oracle.soa.adapter] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@19c243d]*
    [userId: <anonymous>] [ecid: 0000IptyLrL9_aY5TrL6ic1DBOS_000009,0] [APP: soa-infra] File Adapter FileAdapterTriggerFilePOC PostProcessor::
    Delete failed, the operation will be retried for max of [0] times
    [2011-01-12T16:55:48.639+05:30] [soa_server1] [WARNING] [] [oracle.soa.adapter] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@19c243d]
    [userId: <anonymous>] [ecid: 0000IptyLrL9_aY5TrL6ic1DBOS_000009,0] [APP: soa-infra] File Adapter FileAdapterTriggerFilePOC [[
    BINDING.JCA-11042
    File deletion failed.
    File deletion failed.
    File : C:\Dibya\AttachmentTest\InputDir\TestFile3.txt could not be deleted.
    Delete the file and restart server. Contact oracle support if error is not fixable.
    If any one has faced similar issues, kindly provide pointers on how to resolve it.
    Regards,
    Dibya

    Hi,
    Using the file adapter, you can poll from multilple locations...
    Keep the following property in your .jca file
    <property name="DirectorySeparator" value="," />
    While giving the path in File Adapter configuration, keep comma and give the next location....then the file will be picked up from the locations you gave....
    Hope this helps...
    Thanks,
    N

  • XI file adapter polling faster than poll interval

    Hi,
    We are facing a issue with the file adapter/authorization of the FTPUSER.
    We FTP a server and pick up a file from a particular folder.
    My polling interval is 2 minutes
    My retry interval is space.
    Processing mode : ARCHIVE
    We are archiving it on a Network attached server(NAS) mounted on our XI server.
    When XI polls for the first time it picks up the file but the sender file adapter shows following error in RWB.
    <b>2006-01-20 11:31:08 GMT: Error: Deleting of file 'ARUCSjnewb80.txt' failed - cannot proceed: FTPEx: ARUCSjnewb80.txt: Access is denied.</b>
    The picked up file gets processed but at the same time just within 12-13 seconds of the first poll XI picks up the file second time and then in another 3 seconds for the third time.
    After this the file gets archived thrice in the archive directory and then gets deleted from the source directory.
    We are unable to understand why XI is polling  again  after few seconds of the first poll.(As per my understanding it should have polled after 2 minutes).
    I am able to delete the file manually from the Ftp server.
    Could anyone give a pointer towards what we are missing or what probable reasons could be?
    authorization issue?( XIADM /ftpuser have full authorization)
    Some adapter setting?
    Regards,
    Sulakshana

    Hi,
    Could you let me know how frequent the file gets loaded to the FTP server.
    Is your file size too large to get loaded.. If so try to increase the polling interval. Also make sure that you have provided the polling time in sec and not in minutes...i.e for 2 minutes it should have been specified as 120 sec as polling interval
    Regards,
    Nithiyanandam

  • File Adapter polls all the files from the directory when deployed again

    Hi,
    File Adapter polls all the files from the inbound directory irrespective of the timestamp when deployed again.
    For ex. when the BPEL process with file adapter is deployed, it starts polling the directory based on the timestamp as and when the directory is written with the files. I did not opt for deleting the files after read by the File Adapter.
    But, when BPEL process is modified and deployed again, this time, the file adapter picks up all the files in the inbound directory and doesn't consider the timestamp.
    My guess is that it should not pick all the files but based on timestamp only.
    I guess I can observe the same behavior if I bounce the Application Server also
    Do I have an option to achieve this?
    Thanks,
    Sasi Bhushan.

    try this:
    1- create a File object for the directory. (look at isDirectory() )
    2- create a File[] that represents the files in that directory. (.listFiles())
    3- if (file[x].isDirectory()) {recursive method call;}
    4- else {
    process file;
    If you want more help--do some work on it, and come back with specific questions relating to specific lines in your code and specific error messages you've been receiving.

  • Polling for new Data in Tables with SQL-functions

    Hi
    In my table I have 2 columns:
    event_state : integer (0 = unread, 1 = read)
    min_process_time : date
    In the DB-Adapter-Wizard I can configure my event_state-Field for using as logical delete field. In the SQL-Query there is a
    ... WHERE event_state=0
    But, I only want to query all new entries in this table, where
    min_process_time > SYSDATE.
    How can I configure my toplink-mapping, that SYSDATE can be used in the polling-query? If I use plain-sql instead of the expression from the Wizard (last page), then this sql-statement is ignored. In an expression I only can use a constant-value.
    Any idea?
    Thanks
    Gregor

    Hi
    I am creating a database Polling (logical delete OPEN to CLOSED) adapter that polls a table for records which have a "SCHEDULED" date field.
    The Polling Adapter should pick up those records where the status is OPEN and SCHEDULED<=SYSDATE.
    DB Adapter wizard does not allows this where clause(SCHEDULED<=SYSDATE) to be set; so i tried modifying the Toplink SQL with custom SQL. But it does not works. Please suggest a workaround.
    Please help.
    Thanks
    Debashis

  • DB Adapter -Polling SQL and  After Read SQL:

    Hi..,
    I have DB adapter Configured for logical delete. Here is the SQLs
    Polling SQL:
    SELECT LOG_ID, ORG_ID, ROUTE, ATTRIBUTE9 FROM GETS_UX.GETS_UX_PROF_TRANS_LOG WHERE (((ROUTE = 'ERP INBOUND') AND (((ORG_ID = 123) OR (ORG_ID = 234)) OR (ORG_ID = 5))) AND ((ATTRIBUTE9 <> 'Y') OR (ATTRIBUTE9 IS NULL))) FOR UPDATE SKIP LOCKED
    After Read SQL:
    UPDATE GETS_UX.GETS_UX_PROF_TRANS_LOG SET ATTRIBUTE9 = 'Y' WHERE (ORG_ID = #ORG_ID)
    My Question is. Do we have option to edit After Read SQL.
    I want to add condition in After Read SQL to update the records which i read in above select Query. Is it valid question or my understanding for this Config is wrong.
    I have configured Org id as unique key in DB config. seems that made Update Query to use ORG_ID as param.
    Thanks in advance
    Sujan

    I have configured Org id as unique key in DB configThat's probably the cause of your issue... You have to give here a field that DbAdapter can use to address one unique row in the table so it can mark it as processed...
    I want to add condition in After Read SQL to update the records which i read in above select QueryOnce you have the right configuration that shouldn't be needed... DbAdapter will update the lines one by one...
    Hope this helps...
    Cheers,
    Vlad

  • OSB DB Adapter Polling Issue

    Hello Everybody,
    Requirement
    I am doing DB Adapter polling in OSB.I have a db adapter which polls order table whenever there is a record with status='N'.The OSB component is on single node of Weblogic Server.
    1.The db adapter picks the order data with status='N' in the proxy service
    2.It transforms to webservice xsd
    3.Invokes a webservice.
    4.The webservice returns acknowledgement number.
    5.The order table should be updated with status 'Z' and attribute1=acknowledgement number
    OSB Service Design
    1.Proxy service calls business service to poll the order table
    2.Converts the payload to the xsd format required by target
    3.Invokes the webservice on target
    4.Receives acknowledgement number
    5.calls a plsql procedure which updates all the records within this batch with the acknowledgement number and status='Z'
    My configurations in db adapter
    Logical delete option in db adapter.
    Unread Value :'N'
    Read Value : 'A'
    Polling frequency : 300 seconds
    no of databse rows per XML document : 10
    Database rows per transaction : 10
    Issue
    1.My process after getting the acknowledgement number it updates the status with Z and attribute1=acknowledgement number.At the of this transaction I am seeing that the status is being updated by
    the adapter to 'A' based on read value.I want the read value only to be updated initially but as soon as my OSB process picks it for further processing it should not update again.How can i prevent
    the status from getting updated to 'A'.
    2.I have 40 records in order table.Per the database rows per transaction it should process 10 records at a time and for each batch of 10 i should get one acknowledgement number.Instead i see that
    all the 40 records are updated with the same acknowledgement number.Kindly help as to how I can resolve this situation.
    Thanks & Regards,
    Radha

    Hi Arik,
    I tried setting the property(idempotent) in jca file of the polling adapter and it gave me below error.Kindly help
    <adapter-config name="EBS_FETCHDATA" adapter="Database Adapter" wsdlLocation="EBS_FETCHDATA.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/DB/newebs" UIConnectionName="EBS" adapterRef=""/>
    <endpoint-activation portType="EBS_FETCHDATA_ptt" operation="receive">
    <activation-spec className="oracle.tip.adapter.db.DBActivationSpec">
    <property name="DescriptorName" value="EBS_FETCHDATA.XxcmfOtmOrderHdrIfaceTmp"/>
    <property name="QueryName" value="EBS_FETCHDATASelect"/>
    <property name="MappingsMetaDataURL" value="EBS_FETCHDATA-or-mappings.xml"/>
    <property name="PollingStrategy" value="LogicalDeletePollingStrategy"/>
    <property name="MarkReadColumn" value="OTM_INTERFACE_STATUS"/>
    <property name="MarkReadValue" value="A"/>
    <property name="MarkUnreadValue" value="N"/>
    <property name="PollingInterval" value="60"/>
    <property name="MaxRaiseSize" value="10"/>
    <property name="MaxTransactionSize" value="300"/>
    <property name="NumberOfThreads" value="1"/>
    <property name="ReturnSingleResultSet" value="false"/>
    <property name="idempotent" value="false"/>
    </activation-spec>
    </endpoint-activation>
    </adapter-config>
    ---------------------ERROR---------------
    Invalid JCA transport endpoint configuration, exception: javax.resource.ResourceException: BINDING.JCA-12532 Cannot set JCA WSDL Property. Error while setting JCA WSDL Property. Property setIdempotent is not defined for oracle.tip.adapter.db.DBActivationSpec Please verify the spelling of the property.
    Thanks,
    Radha

  • Weird problem in File Adapter polling

    Hi Guys,
    My BPEL process is working fine not until today wherein the File Adapter cannot poll for new files in the target directory. I tried restarting the bpel server and still my bpel process was not able to poll for new files. I tried creating a test bpel process and configure the file adapter (see below):
    Operation Type: Read
    Archive processed files: Enable
    Delete files after successfule: Enable
    Include files with pattern: *.csv
    Publish messages in batches of: 1000
    Polling frequency: 5 seconds
    Minimum file age: 0 seconds
    Sample File: test.csv
    12345,12345,12345
    When I tried testing it, the file was deleted but it was not able to archive the file and bpel process did not appear in the instance tab of BPEL console. I have check the domain.log and orabpel.log files and it didn't show any exceptions or error (log level is set to error)
    Any idea how to fix this problem?
    FYI, I'm using the version 10.1.3.1.
    thanks,

    What does your process do other than poll files, does it call any other adapter / service. This is more likely the issue although I have seen issues with the file and ftp adapter in 10.1.3.3 and 10.1.3.1. I never sorted the issue it just seemed to affect that process.
    10.1.3.1 is really out of date and has a number of issues you should look at upgrading to 10.1.3.4 or 10.1.3.5 but I have seen some posts that have issues with 10.1.3.5.
    cheers
    James

Maybe you are looking for

  • ITunes 8.1.1 no longer recognizing either of my iPod Touch 2g devices

    Okay, no idea what I did or what changes have occurred but today iTunes 8.1.1 stopped seeing my iPod Touch 16GB 2g. I rebooted the Mac. I rebooted the iPod Touch. I tried connecting my iPod Touch to my wife's Windows computer- where it was recognized

  • Multiple desktops/different icons?

    I am a student and I use my new mbp for lots of school related things, and it would be so easy and much neater looking if I could have all school related links and icons on one desktop, and personal things on another. But I can't figure out how; no m

  • Canon HF100 Premiere Pro CS6

    Hello there.  We're a Media and Film department in a UK school, and, having just upgraded to Premiere Pro CS6 from Final Cut Express, we are experiencing difficulties importing footage from our Canon HF100 cameras.  We are using OSX 10.8.5.  If there

  • How to Listen an event before the page Renders

    Hi , we fired an event from the header . I want to listen the payload and show that data from the payload in a portlet on the page. But am not getting the data into the portlet. From the logs i can see that after the pageflow action executed, backing

  • Unable to call OUI

    Hi, Details OS: Windows I alredy installed oracle s/w and database also. Due to some nwk issue i've done system restore. Now i am unable to see Oracle10 in Windows start button. I thought it has gone and i am trying to install again but i am unable t