Rollback in case of DB polling

Hi All,
We have a requirement to poll db, we will update a field on table for the polled records. After applying some teansformations to these records, these will be published to JMS queue.
We want to maintain transaction here, so that if the JMS publish fails, the record is not lost and will be retried.
Could you please let me know if this is possible? Then how it can be achieved, and what will happen to the feild that is updated in DB after DB polling? will that be reset?
thanks
Kedar

Kedar,
If you are using XA transaction in your data source definition (to poll the data from the DB) it will be easy for you.
When there is an exception on the JMS invocation, the poll data will be rolled back(assuming between the receive & invoke activity you have only assign/trans' activity).
Do a small test....
Arik

Similar Messages

  • Polling from the database view in BPEL 11g

    Hi,
    We do have a requirement of polling from the database view in BPEL 11g. I am exploring the following polling strategies in our case:
    - Delete
    - Logical Delete
    In case of Delete polling strategy, can we delete the record as the view does not allow deletion. In this case, do we have any other way to achieve this functionality?
    In case of Logical Delete, We have to mark the status column with particular value. how could we achieve the same when the view is not updateable.
    In 10g, we can override the delete polling strategy with an update statement. Is it possible in 11g?
    Thanks & Regards
    Siva

    Hi,
    I am also doing the same thing what you have done, please help me.
    I have used BPEL export utility for exporting my JPDs to BPEL. but it was not a good help, ultimately i m creating a process manually.
    the main problem what is the replacement of control(jcx files)
    please guide me really it would be great help..
    Thanks in advance and hope to hear from you.
    my mail id is [email protected]
    please send some document if you have...

  • Commit and rollback on session level

    Hi All,
    I am calling one stored procedure and I am doing some dml operation in that sp. there after I calling another sp which contain some ddl operations. if process may be fail in somewhere I wanted to rollback all dml transactions.
    So I wanted to commit and rollback on session level. Is such kind of concept available in oracle.
    Prashant.

    Prashant,
    Not sure what you are talking about.
    Commit and rollback is always on session level!!!!
    Also all DDL statements are automatically committed, and rollback in case of errors is always statement level rollback.
    So let's assume
    begin
    insert into foo...;
    update foo...;
    execute immediate 'alter table foo add (last_update date)';
    end;
    exit
    and the alter table fails:
    1 alter table is rolled back
    2 insert and updates are not rolled back.
    If the alter table succeeds
    all statements are committed and you can't roll them back anymore.
    This is why issuing DDL in stored procedures has unwanted side effects and should be conisdered pure evil.
    Sybrand Bakker
    Senior Oracle DBA
    Experts: those who did read the documentation.

  • Rollback of Messages in OSB

    I have a usecase as below -
    jms.Q1 (nonxa) -- [ proxy service -- publish to a jms.Q2 (xa) -- raise an error ]
    A proxy service receives request from non-xa queue (Q1) ,
    then the proxy service publish that message to another queue (Q2) via XA enabled business service (i use connection factory as XA) ,
    then i raise an error in the message flow.
    What i need is, I want to rollback the message which i published to "Q2" once i raise an error in message flow.
    Can anyone please help me out whether this is possible by using any of the routing option,etc..?
    Regards
    Sesha

    Configure these:
    1. Enable the option Same Transaction For Response in the Proxy Service configuration.
    2. Use QoS as Exactly Once in the publish action which calls the JMS business service.
    3. Use XA connection factory for connection between businsss service and target JMS Queue
    4. Make sure that the error reaches System Error Handler. To ensure this you need to make sure that the flow does not encounter any Reply action after the Raise Error action you have configured in the message flow.
    Once you configure like above:
    1. Message will be deleted from source queue as soon as OSB Proxy picks up the message (since this is not XA enabled)
    2. Message will be published to target JMS queue but not committed till the message flow is completed. So it can rollback in case there is an error after the publish action.
    3. If based on a condition a Raise error action is executed (or any other error happens in the flow) message will be rolled back from target queue in case the error reaches the System Level error handler. So message will not be present in neither source queue nor the target queue.

  • Wrong Case or ClassCastException

    Hello everyone
    I use JWSDP2.0, JDK is jdk1.5.0_12
    I have tried to generate class by the command:
    xjc -p test.jaxb poll.xsd
    Following is the schema
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xsd:element name="Poll" type="Poll"/>
         <xsd:complexType name="Poll">
              <xsd:sequence>
                   <xsd:element name="queryName" type="xsd:string"/>
                   <xsd:element name="params" type="QueryParams"/>
              </xsd:sequence>
              <xsd:anyAttribute processContents="lax"/>
         </xsd:complexType>
         <xsd:complexType name="QueryParams">
              <xsd:sequence>
                   <xsd:element name="param" type="QueryParam" minOccurs="0" maxOccurs="unbounded"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="QueryParam">
              <xsd:sequence>
                   <xsd:element name="name" type="xsd:string"/>
                   <!-- See note in EPCIS spec text regarding the value for this element -->
                   <xsd:element name="value" type="xsd:anyType"/>
              </xsd:sequence>
         </xsd:complexType>     
    </xsd:schema>I modify the poll.java, and add @XmlRootElement in front of the class declaration.
    Then I write code to test marshall and unmarshall
    package test;
    import java.util.List;
    import java.io.*;
    import javax.xml.bind.*;
    import org.w3c.dom.*;
    import test.jaxb.*;
    public class JAXBTest {
         public static void main(String[] args){
              try {
                   JAXBContext context = JAXBContext.newInstance("test.jaxb");
                   ObjectFactory factory = new ObjectFactory();
                   Marshaller marshal = context.createMarshaller();
                   marshal.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
                   Unmarshaller unmarshal = context.createUnmarshaller();
                   Poll poll = factory.createPoll();
                   poll.setQueryName("Query1");
                   QueryParams params = factory.createQueryParams();
                   List list = params.getParam();
                   QueryParam param = factory.createQueryParam();               
                   param.setName("Name");
                   param.setValue("David");
                   list.add(param);
                   poll.setParams(params);
                  OutputStream os = new FileOutputStream( "poll.xml" );
                  marshal.marshal( poll, os );     
                  marshal.marshal(poll,System.out);
                  Poll input = (Poll)unmarshal.unmarshal( new File( "poll.xml" ) );
                  System.out.println(input.getQueryName());
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }I found the root element is generated to "poll", not the schema defined "Poll"
    But marshall and unmarshall are ok.
    In order to comform the schema, I modify Poll.java again.
    Change @XmlRootElement to @XmlRootElement(name = "Poll")The result is I can generate the right case element now("Poll").
    But I get the exception simultaneously, unmarshall is not ok
    java.lang.ClassCastException: javax.xml.bind.JAXBElement
         at test.JAXBTest.main(JAXBTest.java:29)
    is there any resolution to solve wrong case problem and make marshall/unmarshall ok?
    Message was edited by:
    chihwen

    Hi,
    As far as I know Oracle are porting Developer R6 to Linux.
    We're also anxiously waiting for it to be out.
    It should be out in 2 or 3 months.
    About CASE I don't thing anyone will port it to linux.
    Regards,
    Michael
    Jose Abelardo Gutierrez (guest) wrote:
    : My company is looking for CASE or RAD tools for database system
    : developement on Linux.
    : If I can find something that suits our needs we will change all
    : our application developement schema to Linux, and I'll very
    : happy, and our client to.
    : Thanks for your reading
    null

  • BC4J commit/rollback transaction

    I'm using the following code (copied from the complete UIX BC4J application) to delete a row:
    <event name="removeCaractGrupo">
    <bc4j:findRootAppModule name="GruposMineriosAppModule">
    <bc4j:findViewObject name="ClasseAtualCaractGrupoMinerioView">
    <bc4j:findRowByKey>
    <bc4j:keyBinding>
    <bc4j:selectionKey name="caractGruposData" key="keyCaractGrupo" />
    </bc4j:keyBinding>
    <bc4j:handlers>
    <bc4j:removeRow />
    <bc4j:executeQuery/>
    </bc4j:handlers>
    </bc4j:findRowByKey>
    </bc4j:findViewObject>
    <bc4j:commit/>
    </bc4j:findRootAppModule>
    </event>
    It works fine but if the row cannot be removed because of a constraint violation the row is still removed from the viewObjectScope and appears again only if I send a <bc4j:rollback/> command.
    The question is: is there any approach like a try/catch within the uiXML event handler??
    <ui:try>
    <contents>
    <bc4j:commit/>
    </contents>
    <ui:catch>
    <bc4j:rollback/>
    </ui:catch>
    </ui:try>
    Or do I have to call a Java class method to do this??

    There's nothing like <try>/<catch> in the event handler section. It looks like you'd need to replace the commit handler here with handcoded Java that will rollback in case the commit fails.

  • Rollback Questions for 10.1.3.1

    Hi all,
    I have some issues with rollback in a bpel process.
    I have all partner links (DB adapters and File Adapters) with transaction=participate and the process as well.
    I have a partner link that uses a Local transaction (because I want to commit only that operation), all the other uses a XA transaction.
    All the rest I want to rollback in case of error.
    I have a Throw with Rollback but before that I have a Reply informing the client that the process is ongoing.
    Inside the scope that have the Rollback Throw, if the process gives an error in one place, he can do the rollback, but in another place, he can't.
    I'm not understanding this behavior, can you please help?
    Thank in advance.
    CD
    Edited by: user586904 on Oct 20, 2009 6:20 PM
    I forgot to say that is a Sync process.

    Hi CD,
    I developed a process similar to your process in 10.1.3.3
    I think throwing rollback exception will not undo the DB operations that are allready done.
    Even if you use transaction=participate property it will not perform the rollback operation.
    transaction=participate will not commit the transaction untill it completes successfully... so in your second scope if exception occurs it will go that scope catch and from there to main catch.
    It means your process completed successfully by catching the inner scope fault.
    EX: In your inner scope fault occurs during file reading first two DB operations in that scope will get commited.
    Now in Main Scope after catching the inner fault throw any fault.
    It means your process is not completed.... in this case Inner scope DB operations will not get commited.
    Hi Experts
    Please correct me if i am wrong.
    Really will bpelx:rollback perform the rollback operation
    Regards
    Pavankumar
    Edited by: [email protected] on Oct 22, 2009 3:21 AM
    Edited by: [email protected] on Oct 22, 2009 3:21 AM

  • Regarding 9.2.0.8 patch rollback

    Hi,
    My database is running in 9.2.0.6 version, now I am going to apply 9.2.0.8 patch. If anything goes wrong while I am applying patch, isit anyway there to rollback again to 9.2.0.6 version.

    I think the patch notes (readme.htm) contains instructions regarding rollback in case of failure.
    It is always better (and is recommended in the patch notes also) to take a complete cold backup of database before proceeding with anything.

  • JMS - rollback but no redelivery

    All,
              I have a simple pub/sub on weblogic 8.1 that has a independent thread doing sychronous consumption. The session is transacted. Everything is smooth except when I attempt to rollback a transaction. In such a case, the message is not redelivered when I re-invoke the receive method 1 minute later. It is discarded.
              Looking at the pending messages on the queue, the message is always discarded 40 seconds after transaction is rolled back. If I shorten my wait and call the receive method 20 seconds after the rollback, the message is discarded after 20 seconds on the receive call. I was expecting to pull the message I had previously pulled.
              Message has infinite lifespan, redelivery limit is infinite. I also created a template and hardcoded the redelivery limit for the jms server and topic with no success.
              Any pointers or leads would be appreciated.
              thanks - Dan

    Tom,
              I pasted relevant pieces of config.xml and the listener code below, I hope it's intelligible. We're using the default ConnectionFactory.
              We're using topics and TopicSubscriber for consumption. The flow here is consume a message through receive(), attempt to deliver this message to our client, rollback in case of failure, sleep 60 seconds, then attempt redelivery. When receive is invoked the second time, the message is gone. TopicSession code and the line that does invokes the rollback are surrounded by -------------.
              - Dan
              ------------portions of config.xml---------------
              (the first JmsServer entry was not created by me, second was)
              <JMSServer Name="WSStoreForwardInternalJMSServerwlsD01S001"
              Store="FileStore" Targets="wlsD01S001">
              <JMSQueue CreationTime="1085198870801"
              JNDIName="jms.internal.queue.WSStoreForwardQueue"
              JNDINameReplicated="false" Name="WSInternaljms.internal.queue.WSStoreForwardQueuewlsD01S001"/>
              <JMSQueue CreationTime="1085198871294"
              JNDIName="jms.internal.queue.WSDupsEliminationHistoryQueue"
              JNDINameReplicated="false" Name="WSInternaljms.internal.queue.WSDupsEliminationHistoryQueuewlsD01S001"/>
              </JMSServer>
              <JMSServer Name="Gov JMS Server WLSD04S001"
              Store="Gov JMS File Store" Targets="wlsD01S001" TemporaryTemplate="MyJMS Template">
              <JMSTopic CreationTime="1135118604257" JNDIName="GovJMSTopic"
              Name="Gov JMS Topic" Template="MyJMS Template"/>
              </JMSServer>
              <JMSFileStore Directory="govJmsFileStore" Name="Gov JMS File Store"/>
              <JMSTemplate ExpirationPolicy="Discard" Name="MyJMS Template" RedeliveryDelayOverride="0" RedeliveryLimit="250"/>
              -----------------portions of listener code---------------
              public class RubyMessageListener extends Thread
                   private TopicConnection topicConnection = null;
                   private TopicSession topicSession = null;
                   private TopicSubscriber topicSubscriber = null;
                   Context jndiContext = null;
                   private RubyMessageListener() {;}
                   public RubyMessageListener(String url, AgmemsFilter aFilter, ClientManager cmParam)
                             throws NamingException, JMSException, ConfigurationException
                             Create a JNDI API InitialContext object if none exists
                             yet.
                             jndiContext = new InitialContext();
                                  We're taking care of the connection establishment at object
                                  startup time so that if we throw exception, we can throw
                                  exception back up to subscribe caller who can report NG to
                                  client
                                  Look up connection factory and queue. If either does
                                  not exist, exit.
                             TopicConnectionFactory topicConnectionFactory = null;
                             Topic topic = null;
                             TextMessage message = null;     
                             topicConnectionFactory = (TopicConnectionFactory) PortableRemoteObject.narrow(jndiContext.lookup("weblogic.jms.ConnectionFactory"), TopicConnectionFactory.class);
                             topic = (Topic) PortableRemoteObject.narrow(jndiContext.lookup("GovJMSTopic"), Topic.class);
                             Create connection.
                             Create session from connection; true means session is
                             transacted.
                             Create receiver, then start message delivery.
                             Close connection.
                        topicConnection = topicConnectionFactory.createTopicConnection();
                        topicSession = topicConnection.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
                        topicSubscriber = topicSession.createSubscriber(topic);
                        topicConnection.start();
                        myLogger.info("RubyMessageListener(): queue connection has been started, now listening on events");
                   public void confirmAndFallout(TopicSession ts, String sleepTime, boolean commitFlag)
                        try
                             if (commitFlag)
                                  ts.commit();
                                  myLogger.info("confirmAndFallout(): transaction is committed.");
                             else
                                  ts.rollback();
                                  myLogger.info("confirmAndFallout(): transaction successfully rolled back, must wait the sleepTime, " + sleepTime + " ms, before pulling message off of queue.");
                                  try
                                       Thread.sleep(Integer.parseInt(sleepTime));
                                  catch (Exception e)
                                       myLogger.error("confirmAndFallout(): After rollback, thread sleep failed, moving on without sleep.");
                             myLogger.info("confirmAndFallout(): sleep has been completed, return to event listening.");
                             return;
                        catch (JMSException je)
                             try
                                  myLogger.error("confirmAndFallout(): Unable to confirm delivery transaction, sleep, then try once more before bailing.");
                                  Thread.sleep(Integer.parseInt(sleepTime));
                                  if (commitFlag)
                                       ts.commit();
                                       myLogger.info("confirmAndFallout(): transaction is committed.");
                                  else
                                       ts.rollback();
                                       myLogger.info("confirmAndFallout(): transaction successfully rolled back.");
                             catch (Exception e)
                                  myLogger.error("confirmAndFallout(): The second attempt at jms confirmation has failed, return.");
                                  return;
                   public void run()
                        try
                             myLogger.info("run(): Client has asked us to begin pulling events for url: " + listenerUrl);
                             while (!haltFlag)
                                  myLogger.info("run(): BACK up at top of receive loop");
                                  StringBuffer errstr = new StringBuffer();
                                  //receive will initiate our jms transaction,
                                  //commit or rollback will end the transaction
                                  //receive is blocking, wait 55 minutes before committing
                                  //transaction and looping again. We do this to avoid
                                  //default 60 minute transaction timeout
                                  Message m = topicSubscriber.receive(3300000);
                                  if (m != null)
                                       if (m instanceof TextMessage)
                                            TextMessage message = (TextMessage) m;
                                            String messageText = "";     
                                            String eventType = "";
                                            Document doc;
                                            Node rootNode=null;
                                            try
                                                 messageText = message.getText();
                                                 myLogger.info("run(): the following message has been pulled from the queue: " + messageText);
                                                 eventType = "";
                                                 doc = rubyxml.stringToXML(messageText);
                                                 rootNode = doc.getFirstChild();
                                            catch (Exception e)
                                                 myLogger.error("run(): unable to understand the message we've pulled off the queue, commit transaction and continue. " + listenerUrl + " will not be receiving this message.");
                                                 confirmAndFallout(topicSession, listenerSleep, true);
                                                 continue;
                                            String operationNodeName = "";
                                            if (rootNode!=null)
                                                 operationNodeName = rootNode.getNodeName();
                                            myLogger.info("run(): operationNodeName: " + operationNodeName);
                                            if (operationNodeName.equals("tktInfoEvt"))
                                                 eventType = "tktInfoEvt";
                                            else if (operationNodeName.equals("prmInfoEvt"))
                                                 eventType = "prmInfoEvt";
                                            else if (operationNodeName.equals("rubyFacilityStatusEvt"))
                                                 eventType = "rubyFacilityStatusEvt";
                                            else if (operationNodeName.equals("killEvt"))
                                                 eventType = "killEvt";
                                            else
                                                 eventType = "heartbeatEvt";
                                            /** If the message is a rubyFacilityStatusEvt,
                                                 tktInfoEvt, or prmInfoEvt
                                                 - perform filter(listenerUrl, mcn) to determine
                                                 whether our client cares about this message
                                                 - if client cares, stamp(url) to refresh clock,
                                                 convert the xml string to java class, and send
                                                 message
                                                 - if client does not care, invoke discardedMsg(mcn)
                                                 and commit the transaction
                                                 - if ws request succeeds, commit
                                                 - if ws request fails, rollback and sit tight      
                                                 for one minute
                                            else if (eventType.equals("rubyFacilityStatusEvt") ||
                                                      eventType.equals("tktInfoEvt") ||
                                                      eventType.equals("prmInfoEvt"))
                                                 String mcn = rubyxml.getValueByTag((Element)rootNode, "mcn", errstr);
                                                 if (gs.filter(listenerUrl, mcn)
                                                      == AgmemsFilter.FILTER_PASSED)
                                                      myLogger.info("run(): we've pulled a " + eventType + " message off of the queue and it's time to send it out to client: " + listenerUrl);
                                                      messageCount += 1;
                                                      Socket agmemsSocket = null;
                                                      try
                                                      if (eventType.equals("rubyFacilityStatusEvt"))
                                                                agmemsSocket = HttpUtilities.sendCommand(cu.populateFacilityEvt(facStatusServiceUrl, messageText, messageCount, facStatusAction, rdate, agmemsUsername, agmemsPassword, "", false), agmemsHost, Integer.parseInt(agmemsPort), Integer.parseInt(agmemsTimeout), facStatusServiceUrl);
                                                      else if (eventType.equals("tktInfoEvt"))
                                                                agmemsSocket = HttpUtilities.sendCommand(cu.populateTicketEvt(tktInfoServiceUrl, messageText, messageCount, tktInfoAction, rdate, agmemsUsername, agmemsPassword), agmemsHost, Integer.parseInt(agmemsPort), Integer.parseInt(agmemsTimeout), tktInfoServiceUrl);
                                                      else
                                                                agmemsSocket = HttpUtilities.sendCommand(cu.populatePrmEvt(prmInfoServiceUrl, messageText, messageCount, prmInfoAction, rdate, agmemsUsername, agmemsPassword), agmemsHost, Integer.parseInt(agmemsPort), Integer.parseInt(agmemsTimeout), prmInfoServiceUrl);
                                                      catch (Exception e)
                                                           //these are the kind of failures,
                                                           //timeout, socketException, etc. that we
                                                           //would like to retry
                                                           myLogger.error("run(): ERROR, " + eventType + " push was unable to be sent to " + listenerUrl + " because of following exception, rolling back transaction." + e);
              ------------------------                         confirmAndFallout(topicSession, listenerSleep, false);
                   continue;
                                       myLogger.info("run(): Continued to readReplyFromSocket");
                                                      StringBuffer respStr = new StringBuffer();
                                                      try
                                                           HttpUtilities.readReplyFromSocket
                                                                (agmemsSocket, respStr);
                                                           myLogger.info("run(): response returned was " + respStr);
                                                      catch (Exception ie)     
                                                           //rollback, something wrong on client side
                                                           myLogger.error("run(): ERROR, " + eventType + " NOT delivered to " + listenerUrl + " rolling back transaction. " + ie.toString());
                                                           confirmAndFallout(topicSession, listenerSleep, false);
                                                           continue;
                                                      int agmemsMessageNumber=0;
                                                      agmemsMessageNumber =
                                                           cu.parseAgmemsResponse(respStr.toString());
                                                      if ((agmemsMessageNumber==-1) ||
                                                           (agmemsMessageNumber!=messageCount))
                                                           confirmAndFallout(topicSession, listenerSleep, true);
                                                           myLogger.error("run(): ERROR, " + eventType + " push response came back with NOT delivered to " + listenerUrl + " confirming transaction.");
                                                      else
                                                           confirmAndFallout(topicSession, listenerSleep, true);
                                                           myLogger.info("run(): " + eventType + " delivered to " + listenerUrl + " and transaction is committed.");
                                                 //Assumes CLIENT_INACTIVE return
                                                 else
                                                      //commit for cleanup only
                                                      confirmAndFallout(topicSession, listenerSleep, true);
                                                      setHaltFlag(true);
                                                      myLogger.error("run(): " + eventType + " NOT delivered to " + listenerUrl + ", CLIENT_INACTIVE, halting message receive on this listener.");
                                            else
                                                 myLogger.error("run(): we've pulled a text message from the queue that is UNKNOWN, commit and continue.");
                                                 confirmAndFallout(topicSession, listenerSleep, true);
                                       else
                                            myLogger.error("run(): we've pulled a message from the queue that is UNKNOWN and not text, commit and continue.");
                                            confirmAndFallout(topicSession, listenerSleep, true);
                                  else
                                       myLogger.error("run(): something strange happened, receive() returned with NO MESSAGE, commit and continue.");
                                       confirmAndFallout(topicSession, listenerSleep, true);
                        catch (JMSException je)
                             myLogger.error("run(): ERROR, exception, cleanup connections: " + je.toString());
                        catch (Exception e)
                             myLogger.error("run(): ERROR, exception, cleanup connections: " + e.toString());
                        finally
                             myLogger.error("run(): broken out of message receive loop, closing session, subscription, and topicConnection and KILLING this thread.");
                             if (topicConnection != null)
                                  try
                                       cm.listenerTable.remove(listenerUrl);
                                       topicSession.close();
                                       topicSubscriber.close();
                                       topicConnection.close();
                                  catch (JMSException e)
                                       myLogger.error("run(): As part of cleanup process, there was an exception attempting to close our topicConnection.");
              Message was edited by:
              whoopsy

  • Using participant polling in connect

    I've heard you can poll your participants in Connect.  You can use this to collect responses to a quiz.  Anyone done this?

    Hi,
    You can add a poll pod in the meeting room from Pods Menu--> Poll Pod--> Add new Poll.
    You can add 3 types of polls - multiple choice, multiple answers and short answer. Participants can then answer the poll after host opens the poll.
    Once all the participants have answered the poll question, host can close the poll and can see the reports in webapp (from where he launched the meeting room).
    Though compaing poll with a quiz won't be right as unlike in a quiz there is no RIGHT answer in case of a poll.
    Hope this info helps!
    Sameer Puri

  • Commit not allowed in Trigger  then how to store the values in table

    Hi,
    Database trigger not allowed to COMMIT in it (directly) or in procedure which is calling from the Trigger. it gives error.
    so my question is:-
    1)How Database internally store the INSERT AND UPDATE value in table which is written in procedure without COMMIT?
    2) Is it necessary to write COMMIT in procedure using PRAGAMA AUTONOMOUS TRANSACTION to store inserted or updated value in table?
    Thanks in advance.

    Hi,
    A trigger is designed to be a part of a transaction, not it's end.
    It is like following these steps (not really accurate, but should give an idea):
    1. programA issues INSERT statement on tableA
    2. 'control' goes over to the database
    3. constraint checks happen
    4. the associated triggers on tableA do their work (e.g. fetching a sequence value for a primary key)
    5. 'control' goes back to programA
    6. programA decides if a commit (no error occurred) or a rollback (error case) has to be issued.
    Did this help? Probably not, I'm not happy with what I wrote, but anyway... :)

  • JDBC sender adapter, ...Processing parameters, Update SQL statement

    in JDBC sender adapter, ...Processing parameters, there is an Update SQL statement field, can u tell me ...why this is required,,,,,and in one of the example scenario...it was given as <TEST>..

    Sudheep,
    In the sender JDBC adapter you have the select query to select data from the database.
    Let us summer 2 cases,
    1. You have <test> in  the UPDATE . In this case, during every polling interval the JDBC adapter will end up selecting the same data from the Database. This would not be needed in most f the cases. Why would you want to select the same data over an over again?
    2. If you have an update Statement in the Update field you can make sure that the data selected in the selected statement is updated so that the same rows are not selected again.
    Take a look at this blog,
    /people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
    Regards
    Bhavesh

  • JDBC receiver and sender concern

    Hello,
    In one of the sender JDBC communication channel we have below queries,
    1) Sender comm channel
    select * from table1 where flag = ' '  
    update table1 set flag ='X' where flag = ' ' 
    We are setting the flag to X to identify which entries are read.
    Suppose while setting the flag 'X' if the user inserts new values which were not part of my selection during the retrieval then the new entries which are not part of my select query would also be set to 'X'.
    2) Receiver JDBC comm channel
    file to jdbc
    suppose i have 1 file with 100 entries inserting into JDBC table. I see that if there is any error at 50th record during insert then database is not rolling back the 50 records that are updated.
    Kindly suggest your inputs .

    >Suppose while setting the flag 'X' if the user inserts new values which were not part of my selection during the retrieval then the new entries which are not part of my select query would also be set to 'X'.
    Basically you need to make setting so that concurrent access to the database server will be avoided. For that you have to go for transaction level serializable (strongest setting)
    >suppose i have 1 file with 100 entries inserting into JDBC table. I see that if there is any error at 50th record during insert then database is not rolling back the 50 records that are updated.
    This might not be possible. You expect rollback in case of error occured in one record. You might need to correct the data that you send  for updates.  Insert is failing due to data issues. But you might want to check whether your JDBC drivers supports transaction.

  • How to justify the values in table using report generation tool kit

    Hi
    How can we align the values in excel table using report generation toolkit.
    like left,right,center.
    Regards,
    hari
    Attachments:
    Report_excel.vi ‏34 KB
    New Bitmap Image.JPG ‏134 KB

    Hi,
    A trigger is designed to be a part of a transaction, not it's end.
    It is like following these steps (not really accurate, but should give an idea):
    1. programA issues INSERT statement on tableA
    2. 'control' goes over to the database
    3. constraint checks happen
    4. the associated triggers on tableA do their work (e.g. fetching a sequence value for a primary key)
    5. 'control' goes back to programA
    6. programA decides if a commit (no error occurred) or a rollback (error case) has to be issued.
    Did this help? Probably not, I'm not happy with what I wrote, but anyway... :)

  • XA Trasaction issue with SAP JCA Adapter

    Using OSB 10gR3
    We have a proxy picking messages from a JMX queue using an XA enabled connection factory (the default weblogic XA connection factory). Proxy service calls a business service which is based on the SAP JCA WSDL and posts an IDOC to SAP system. A Route to node with Routing option Quality of service set as Exactly Once is used to ensure a rollback in case of errors on SAP processing. (Also tried with a service callout in request pipeline to achieve the same result).
    Here are the issues we are facing
    1. If the the SAP Outbound connection on iwafjca resource adapter is set as Local Transaction
    When testing from console the service runs fine. When message is sent from JMS queue we get an error "Transaction already exists". This seems correct as SAP Adapter will try to create a new transaction which will be possible while running from console while when Global transaction is created by JMS queue (when Proxy picked up message from XA enabled queue) SAP Adapter will not be able to create a separate transaction being not a part of XA.
    2. If SAP Outbound connection on iwafjca resource adapter is set as XA Transaction
    Even the business service when tested directly from console fails in this scenario. The error we get is "XA transaction not supported by JCA adapter".
    Any idea how to make the SAP JCA Adapter call a part of global transaction so that failed messages can roll back to the JMS queue?
    Sorry for the long description but I thought it will make it easier :)

    2. If SAP Outbound connection on iwafjca resource adapter is set as XA Transaction
    Even the business service when tested directly from console fails in this scenario. The error we get is "XA transaction not supported by JCA adapter".
    Any idea how to make the SAP JCA Adapter call a part of global transaction so that failed messages can roll back to the JMS queue?The interface provided by SAP (SAP JCO) doesn't support JTA transactions.So there is no way adapter/Connection factory can enlist in global transaction.
    1. If the the SAP Outbound connection on iwafjca resource adapter is set as Local Transaction
    When testing from console the service runs fine. When message is sent from JMS queue we get an error "Transaction already exists". This seems correct as >SAP Adapter will try to create a new transaction which will be possible while running from console while when Global transaction is created by JMS queue >(when Proxy picked up message from XA enabled queue) SAP Adapter will not be able to create a separate transaction being not a part of XA. This is known behavior and If I remember correct there is Bug raised but closed as Work as Designed (I still don't have clear explanation why adapter starts local transaction when underlying connection doesn't even participate ). Solution for this is to Make QOS=Best Effort.This makes sure that the local transaction required by adapter will not conflict with global transaction.
    So if you expecting adapter to participate in global JTA currently it is not supported.
    Thanks
    Manoj

Maybe you are looking for