OIM Transaction Mgmt/Rollback

We have a requirement as follows:
Service A calls OIM to create a user and in turn provision to target
1. Service A triggers OIM User Create at that point, OIM Instead of committing the transaction triggers provisioning to target, it should provision first and then commit OIM user creation.
Or. Create a user in OIM but don't respond to calling service yet, trigger provisioning to target on success respond to service as success, if provisioning fails, delete/rollback the user in OIM.
How can either of case be implemented?
please advise.

As for initiating provisioning, OIM needs User Key and that will be generated only after creation of User In to OIM.
It's difficult to write such queries which will Roll Back everything but it's not recommended as it is against Audit and Compliance but if you want then you can write only with Hard Work. How are you provisioning that Resource from Access Policy or through Event Handler.
Try with putting Event Handler on Pre Insert which will trigger the Provisioning. I haven't tested it but you can give a try and let us know the results.

Similar Messages

  • Is "SET TRANSACTION USE ROLLBACK SEGMENT" only a hint

    I have two users, one makes some inserts in a table.
    The other makes a select which visits many rows.
    I have a big rollback-segment.
    To ensure, both users use this rollback-segment I created a logon-trigger:
    CREATE OR REPLACE TRIGGER a_logon AFTER LOGON
    ON DATABASE
    WHEN ( USER IN ( 'SCOTT', 'BOB' ) )
    BEGIN
    SET TRANSACTION USE ROLLBACK SEGMENT rbs_big;
    END;
    But I still get "snapshot to old" messages from the select, which contains the name off an other rollback-segment in the message.
    The trigger really fires, i tested it by adding an insert-statement to a log-table.
    What`s wrong ?

    The set transaction use rollback segment lasts only until you commit or rollback first time and all other transactions in that session will not be forced to that rbs anymore. Other possible solution could be that other users are accessing same tables / updating them so those sessions can't keep the read consistent image available anymore for your sessions.

  • Set Transaction Use Rollback segment

    Hi everybody. Does It make sense issue a "set transaction use rollback" for a single query that do not update, insert or delete. The trouble is that I get e "SnapShot too Old" for a query that just do a query.
    Thanks!

    No, If you are not making any modifications then you do not generate rollback (or even a transaction to my knowledge). The SNAPSHOT TOO OLD is because a different session has run through the rollback for the read consistent view you need (either because someone made changes to a table you are reading or from delayed block cleanout). Delayed block cleanout is a pretty complicated scenario so I'll leave it to the Oracle documentation to explain that. Just be aware that even if nobody has made changes to the table since you started your query you can still get SNAPSHOT TOO OLD. Thankfully, 9i helps elleviate this somewhat with the introduction of UNDO TABLESPACES.
    Richard

  • Error marking transaction for rollback: java.lang.IllegalStateException in WLI 6.1 SP3

    Hi,
    The following exception occurs, when the workflow was waiting after it has made
    a synchronous call to an external system through WTC Interface.
    I had read Rob's comments earlier for WLI 6.1 SP1 on this exception that there
    would be a fix available for it in the next minor release. For your information,
    I had got this exception in WLI 6.1 SP3. Is still EJB Container's timeout excels
    the JTA's timeout? Can anybody help me out to find a fix for this problem?
    Thanks in Advance,
    Regards
    Jegadeesan.
    The Stack Trace is given below :
    <Error marking transaction for rollback: java.lang.IllegalStateException: Cannot
    mark the transaction for rollback. xid=4362:5b4c62b47adcc632, status=Rolled back.
    [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out
    after 31 seconds
    Xid=4362:5b4c62b47adcc632(6932052),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
    since begin=31,seconds left=30,ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[ecwli001+admin_ecwli001]=(state=active),properties=({weblogic.jdbc=t3://147.149.116.70:50101}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=admin_ecwli001+147.149.116.70:50101+ecwli001+,
    Resources={})],CoordinatorURL=admin_ecwli001+147.149.116.70:50101+ecwli001+)]>
    java.lang.IllegalStateException: Cannot mark the transaction for rollback. xid=4362:5b4c62b47adcc632,
    status=Rolled back. [Reason=weblogic.transaction.internal.TimedOutException: Transaction
    timed out after 31 seconds
    Xid=4362:5b4c62b47adcc632(6932052),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
    since begin=31,seconds left=30,ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[ecwli001+admin_ecwli001]=(state=active),properties=({weblogic.jdbc=t3://147.149.116.70:50101}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=admin_ecwli001+147.149.116.70:50101+ecwli001+,
    Resources={})],CoordinatorURL=admin_ecwli001+147.149.116.70:50101+ecwli001+)]
         at weblogic.transaction.internal.TransactionImpl.throwIllegalStateException(TransactionImpl.java:1492)
         at weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImpl.java:466)
         at weblogic.ejb20.manager.BaseEJBManager.handleSystemException(BaseEJBManager.java:255)
         at weblogic.ejb20.manager.BaseEJBManager.setupTxListener(BaseEJBManager.java:215)
         at weblogic.ejb20.manager.StatelessManager.preInvoke(StatelessManager.java:153)
         at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:124)
         at weblogic.ejb20.internal.StatelessEJBObject.preInvoke(StatelessEJBObject.java:63)
         at com.bea.wlpi.server.principal.WLPIPrincipalBean_u7lmf4_EOImpl.getOrganizationInfo(WLPIPrincipalBean_u7lmf4_EOImpl.java:463)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.getBusinessCalendarProcessor(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Timer.dateAdd(Unknown Source)
         at com.bea.wlpi.server.workflow.action.ActionTimedEvent.getScheduleTimestamp(Unknown
    Source)
         at com.bea.wlpi.server.workflow.action.ActionTimedEvent.execute(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.executeActions(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Task.executeActions(Unknown Source)
         at com.bea.wlpi.server.workflow.Task.activate(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.activateSuccessors(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Decision.activate(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.activateSuccessors(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Decision.activate(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.activateSuccessors(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Task.markDone(Unknown Source)
         at com.bea.wlpi.server.workflow.action.ActionTaskDone.execute(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.executeActions(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Task.executeActions(Unknown Source)
         at com.bea.wlpi.server.workflow.Task.activate(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.activateSuccessors(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Task.markDone(Unknown Source)
         at com.bea.wlpi.server.workflow.action.ActionTaskDone.execute(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.executeActions(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Task.executeActions(Unknown Source)
         at com.bea.wlpi.server.workflow.Task.activate(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.activateSuccessors(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Task.markDone(Unknown Source)
         at com.bea.wlpi.server.workflow.action.ActionTaskDone.execute(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.executeActions(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Task.executeActions(Unknown Source)
         at com.bea.wlpi.server.workflow.Task.activate(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.activateSuccessors(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Task.markDone(Unknown Source)
         at com.bea.wlpi.server.workflow.action.ActionTaskDone.execute(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.executeActions(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Task.executeActions(Unknown Source)
         at com.bea.wlpi.server.workflow.Task.activate(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.activateSuccessors(Unknown
    Source)
         at com.bea.wlpi.server.workflow.Start.activate(Unknown Source)
         at com.bea.wlpi.server.workflow.Workflow.start(Unknown Source)
         at com.bea.wlpi.server.workflow.Workflow.instantiate(Unknown Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean$1.invoke(Unknown
    Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.performWithErrorHandling(Unknown
    Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean.instantiate(Unknown
    Source)
         at com.bea.wlpi.server.workflowprocessor.WorkflowProcessorBean_h7kt4j_EOImpl.instantiate(WorkflowProcessorBean_h7kt4j_EOImpl.java:692)
         at com.bea.wlpi.server.eventprocessor.EventProcessor.checkTrigger(Unknown Source)
         at com.bea.wlpi.server.eventprocessor.EventProcessor.onEvent(Unknown Source)
         at com.bea.wlpi.server.eventlistener.EventListenerBean.onMessage(Unknown Source)
         at weblogic.ejb20.internal.MDListener.execute(MDListener.java:262)
         at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:214)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:1865)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:1819)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

    You could change the transaction timeout value, but I'd re-examine the
    application and see if the transaction times could be reduced some.
    29 seconds seems like a long time.

  • Marking the transaction as rollback in JPD

    I have a stateless JPD (with Client Request with Return as the start node).
    If an exception is thrown anywhere in the JPD and "remains" unhandled the transaction
    rollbacks automatically - which is desired. However any piece that happens as
    a result is that the Process is marked as "Aborted" (on the WLI admin console)
    and the client gets a runtime unhandled exception (SOAP Fault)- which is not wan't
    I wan't to return to the client as a JPD developer.
    So I am stuck as I wan't the transaction to rollback but at the same time I wan't
    to send a more user friendly response (say an XML contract) with the error details....
    I am using WLI 8.1 SP2.
    BEA folks - please speak up ... Do you guys have any inside info. that you could
    please share or point to!
    Thanks very much

    Hi Ric,
    Thanks for your input. Although this document has aided my undertanding of state management and connection pooling, I am still none the wiser as to why I am experiencing this issue.
    On closer inspection I have found that the doDML(int, TransactionEvent) is not being called until I insert a row.
    So if I query my master VO, set the first row to current, update an attribute on a detail row then postChanges on the transaction, doDML does not get called.
    If I insert a row into my detail VO then postChanges on the transaction, it calls doDML issuing the original update I entered in the above step.
    It seems I have a similar problem to the that described in the following thread but there seems to be no outcome.
    Re: doDML() not called at postChanges?
    In my desparation, I am tempted to just insert a row and then remove it just to put the EO's in the correct state if the user updates a row before inserting a new one.
    Any help would be greatly appreciated.
    Thanks.

  • Worked Example on SET TRANSACTION, SAVEPOINT, ROLLBACK, COMMIT

    Does any one know if there is any worked examples on the use of SET TRANSACTION, SAVEPOINT, ROLLBACK, COMMIT?

    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_106a.htm#2067249
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_102a.htm#2065561

  • Apply slowdown on transaction with ROLLBACK TO UBA LCRs

    I have streams configuration consisting of several captures and propagations on four servers an one destination db with several applys.
    Each capture has its own propagation and its own apply on destination server.
    All works almost fine.
    But sometimes one apply process becomes slowly.
    As each stream has heartbeat table with 30 seconds insert/delete sequence, normal delay between message capture time and apply time 1-3 minutes as max.
    But sometimes it became 3-4 hours.
    I started to search the root of problem and found following:
    When problem exist, apply reader process in latch shared pool contention. The OS process of apply reader is at 100% CPU usage.
    DBA_APPLY_SPILL_TXN showing one transaction for that apply.
    I use following script to see contents of that transaction:
    DECLARE
      TYPENM   VARCHAR2(61);
      DDLLCR   SYS.LCR$_DDL_RECORD;
      PROCLCR  SYS.LCR$_PROCEDURE_RECORD;
      ROWLCR   SYS.LCR$_ROW_RECORD;
      RES      NUMBER;
      NEWLIST  SYS.LCR$_ROW_LIST;
      OLDLIST  SYS.LCR$_ROW_LIST;
      DDL_TEXT CLOB;
      EXT_ATTR ANYDATA;
      I        NUMBER;
    BEGIN
      I := 0;
      SELECT COUNT(*)
        INTO I
        FROM aq$qta_strm1 T
       WHERE T.QUEUE = 'QA_STRM1'
       ORDER BY T.MSG_ID ASC;
      DBMS_OUTPUT.PUT_LINE('### CNT: ' || I);
      I := 0;
      FOR C IN (SELECT *
                  FROM aq$qta_strm1 T
                 WHERE T.QUEUE = 'QA_STRM1'
                 ORDER BY T.MSG_ID ASC) LOOP
        IF (C.USER_DATA IS NOT NULL) THEN
          TYPENM := C.USER_DATA.GETTYPENAME();
          IF (TYPENM = 'SYS.LCR$_ROW_RECORD') THEN
            RES := C.USER_DATA.GETOBJECT(ROWLCR);
              DBMS_OUTPUT.PUT_LINE('MSG_ID: ' || C.MSG_ID);
              PRINT_LCR(C.USER_DATA);
              I := I + 1;
          END IF;
        END IF;
      END LOOP;
      DBMS_OUTPUT.PUT_LINE('### NN: ' || I);
    END;And it gives me following:
    <tt>
    ### CNT: 3150
    MSG_ID: 03690459
    source database: SOURCEDB.MYDOMAIN.COM
    owner:
    object:
    is tag null: Y
    command_type: ROLLBACK TO UBA
    transaction_id: 9.46.1687138
    MSG_ID: 03690460
    source database: SOURCEDB.MYDOMAIN.COM
    owner:
    object:
    is tag null: Y
    command_type: ROLLBACK TO UBA
    transaction_id: 9.46.1687138
    MSG_ID: 03690461
    source database: SOURCEDB.MYDOMAIN.COM
    owner:
    object:
    is tag null: Y
    command_type: ROLLBACK TO UBA
    transaction_id: 9.46.1687138
    MSG_ID: 03690462
    source database: SOURCEDB.MYDOMAIN.COM
    owner:
    object:
    is tag null: Y
    command_type: ROLLBACK TO UBA
    transaction_id: 9.46.1687138
    +... and so on ...+
    </tt>
    I didn't find any description about lcr type ROLLBACK TO UBA.
    Whole transaction consists of messages of such type.
    So I just put transaction to IGNORE_TRANSACTION parameter of apply and problem disappeared for now.
    But I believe it will come back again.
    So, who can explain me what lcr type ROLLBACK TO UBA means? where it come from? and how to avoid this problem again?
    PS:
    Source database 10.2.0.4 64bit-linux
    Dest. db 11.2.0.3 64bit-linux
    Edited by: user5464827 on 02.04.2013 0:05

    Hi Onno,
    If you have enabled "auto commit", then you cannot call methods like "commit()" or "rollback()". After you have executed your INSERT, a "commit" automatically happens -- if the INSERT succeeds -- or a "rollback" automatically happens (if the INSERT fails). You are calling the "commit()" method when there is no open transaction -- which is wrong and therefore you get an error (SQLException).
    Same problem occurs when you catch the error caused by your "commit" and try to "rollback" -- you cannot "rollback" when there is no open transaction.
    As I see it, you have two choices:
    1. disable auto commit, or
    2. remove the calls to "commit()" and "rollback()"
    Hope this helps you.
    Good Luck,
    Avi.

  • JMS adapter transaction. Rollback message to queue.

    Hi all !
    A have question about jms adapter transaction. My composite application has 3 steps : JMS adapter (listener), mediator, WS adapter. JMS adapter listen queue push message to mediator, mediator invoke web service. If ws not available (server down), mediator try recovery 5 times. After 5 times, reject message from queue. I wont rollback message to queue. I saw examples with JMS + BPEL, but it not help me. Anybody can help me.

    Hi,
    You don’t need to catch a mediator fault – you can let it rollback to the JMS Queue and let the Queue do the retries.
    To get the retries working, log in to the weblogic console and navigate to JMS Modules -> Your Module -> Your Queue -> Configuration -> Delivery Failure
    Here you will find options for Redelivery Limit. Set this to the number of retries you need.
    Then navigate to the connection factory you want and set the redelivery delay.
    This should get your desired behaviour, but once the message has failed it will be discarded. If you prefer to put it on an error queue you can create an error queue, and in the original queue’s, goto Delivery Failure, change the expireation policy and set the Error Destination to be your error queue.
    Hope that helps!
    Robert

  • Bean Managed Transactions and rollback

    Hi Everybody,
    I am using Bean Managed Transactions in a Message Bean which is called every some time by an EJB3 timer. This Message Bean subsequently calls a Session Bean which uses Container Managed Transactions and uses the default transaction attribute which is SUPPORTS. The Session Bean methods might sometime throw a System Exception(inheriting from RuntimeException) which will rollback the Bean Managed Transaction which was started from the Message Bean.
    When this happens and I try to invoke userTransaction.rollback() I get invalid transaction state exception and I suppose this means that is already rolled back.
    Is there a way to get another transaction or set the transaction back to a valid state so I can carry on with some persistence tasks or the only way to do that is by suppressing the RuntimeException and throwing an Application Exception having the *@ApplicationException(rollback=false)* annotation? Can I suppress a System Exception though?
    Thank you in advance!

    Saroj wrote:
    Hi All,
    I would like to know whether we can use JDBC Connection Object's commit and rollback
    methods to control Transaction in Bean Managed Transactions or not.You may use the JDBC connection's transaction support from an EJB. That being said, you
    need to understand that it won't be the transaction that started declaratively by the
    EJB container nor would it be a bean-managed transaction started through
    UserTransaction.
    FWIW, I question why you'd want to do this though. I'd use container-managed
    transactions and let the container handle this for you. The transaction manager
    includes a 1PC optimization so it's not going to do an XA/2PC tx if you only have a
    single resource in the tx. Also, the EJB container includes all the logic to properly
    handle rollbacks when exceptions are thrown etc.
    Finally, your code will more maintainable and reusable if you use the container-managed
    tx + JTA resources. If I later wanted to call another EJB or another JTA resource (eg
    JMS perhaps) I could do it without having to rewrite all of your code.
    -- Rob
    >
    >
    Why is it required that we should use Java Transaction API to control the Transaction
    in Our Beans?
    I understand that if we are using Multiple Resources and need to use Transaction
    then going for JTA makes sense. If I am using only Resource,for example, Only One
    Connection then we should be able to use Connection's Transaction control.
    I understand that other way to do the transaction is to use Container's transaction
    services.
    Please respond at the earliest.
    Thanks in Advance,
    Saroj

  • Transaction Session, Rollback and Redelivery

     

              Well, apparently this is a bug in Weblogic 6.1 up to sp2. (I can not comment if this
              bug either exists or does not exist in 6.0 and below or 7.0 and above.) Bug ID is
              :CR080301 if this is impacting anyone else. I'll post the final outcome and if
              it gets fixed.
              (I would also ask everyone if you post a question and end up going to BEA, customer
              support, if you could post the outcome, that would make everyone's life so much easier.)
              To respond to me via E-mail, simply pull the weeds. =)
              Tom Barnes <[email protected]> wrote:
              >Hi Mike,
              >
              >As far as I know, Zach's response still stands. The behavior you are seeing,
              >given
              >the limited information posted, doesn't ring any bells. Please forward
              >your issue to
              >customer
              >support, with enough information to reproduce along with a SP number and
              >thread-dumps.
              >They will know if your particular problem has been seen before...
              >
              >If you like, post your reproducer code here, with thread-dumps.
              >
              >Tom
              >
              >P.S. Email addresses on this forum tend to be "bogus" because this is not
              >a formal
              >forum. Think of it as a free Anne Landers for JMS. Posters are volunteers,
              >posting
              >on "their own time".
              >
              >Mike Wiles wrote:
              >
              >> Was there ever any outcome to this issue? I am experiencing the same
              >behavior and
              >> since both of these E-mail addresses are pretty much bogus, it is impossible
              >to get
              >> some sort of follow-up.
              >>
              >> Mike
              >>
              >> To send me an E-mail, simply pull the WEEDS.
              >>
              >> "Zach" <[email protected]> wrote:
              >> >Very strange behavior. You should file a support case.
              >> >_sjz.
              >> >
              >> >"Bart Simpson" <[email protected]> wrote in message
              >> >news:[email protected]...
              >> >>
              >> >> Hi,
              >> >>
              >> >> I am trying to understand, how rollback works with transaction session
              >> >in
              >> >WLS
              >> >> 6.1 sp1. What should happen when session.rollback() is called? After
              >> >calling
              >> >> rollback() couple of times, the server program receiving the messages
              >> >just
              >> >hangs?
              >> >> I have configured redelivery delay to 3000 and redelivery tries to
              >3.
              >> >However,
              >> >> if I restart the server program, then I see the normal redelivery
              >> >happening again.
              >> >> Is this a feature or bug?
              >> >>
              >> >> Here is the client program:
              >> >> package com.malani.jms.client;
              >> >>
              >> >> import java.util.*;
              >> >>
              >> >> import javax.jms.*;
              >> >> import javax.naming.*;
              >> >>
              >> >> import com.malani.jms.resources.*;
              >> >>
              >> >> public class Client {
              >> >>
              >> >> public static void sendMessage(QueueSender aSender, Session aSession,
              >> >int
              >> >> i)
              >> >> throws JMSException
              >> >> {
              >> >> aSender.send(aSession.createTextMessage("" + i));
              >> >> }
              >> >>
              >> >> public static void printUsage() {
              >> >> System.out.println("Usage:");
              >> >> System.out.println(Client.class.getName() + " jndi_queue_name");
              >> >> System.exit(1);
              >> >> }
              >> >>
              >> >> public static void main(String[] args) {
              >> >> if (args.length != 1) {
              >> >> printUsage();
              >> >> }
              >> >>
              >> >> QueueSender aSender = null;
              >> >> QueueSession aSession = null;
              >> >> QueueConnection aConnection = null;
              >> >> try {
              >> >> Properties p = new Properties();
              >> >>
              >> >p.load(JMSProperties.class.getResourceAsStream("jms.properties"));
              >> >> InitialContext aIC = new InitialContext(p);
              >> >> QueueConnectionFactory aFactory = (QueueConnectionFactory)
              >> >aIC.lookup(
              >> >> p.getProperty("queue.connection.factory.name")
              >> >> );
              >> >> aConnection = aFactory.createQueueConnection();
              >> >> aConnection.start();
              >> >> aSession = aConnection.createQueueSession(
              >> >> false,
              >> >> QueueSession.AUTO_ACKNOWLEDGE
              >> >> );
              >> >> Queue aQueue = (Queue) aIC.lookup(args[0].trim());
              >> >> aSender = aSession.createSender(aQueue);
              >> >>
              >> >> int i = 0;
              >> >> for (; i < 20; i++) {
              >> >> sendMessage(aSender, aSession, i);
              >> >> }
              >> >> } catch (Exception e) {
              >> >> e.printStackTrace();
              >> >> } finally {
              >> >> try {
              >> >> if (aSender != null) {
              >> >> aSender.close();
              >> >> }
              >> >> } catch (JMSException e) {}
              >> >> try {
              >> >> if (aSession != null) {
              >> >> aSession.close();
              >> >> }
              >> >> } catch (JMSException e) {}
              >> >> try {
              >> >> if (aConnection != null) {
              >> >> aConnection.stop();
              >> >> aConnection.close();
              >> >> }
              >> >> } catch (JMSException e) {}
              >> >> }
              >> >> }
              >> >> }
              >> >>
              >> >> Here is the server program:
              >> >> package com.malani.jms.transaction;
              >> >>
              >> >> import java.util.*;
              >> >>
              >> >> import javax.jms.*;
              >> >> import javax.naming.*;
              >> >>
              >> >> import com.malani.jms.resources.*;
              >> >>
              >> >> public class Server {
              >> >> public static final String JNDI_QUEUE_NAME =
              >> >"transaction_queue_jndi_name";
              >> >>
              >> >> public static void main(String[] args) {
              >> >> QueueReceiver aReceiver = null;
              >> >> QueueSession aSession = null;
              >> >> QueueConnection aConnection = null;
              >> >> try {
              >> >> Properties p = new Properties();
              >> >>
              >> >p.load(JMSProperties.class.getResourceAsStream("jms.properties"));
              >> >> InitialContext aIC = new InitialContext(p);
              >> >> QueueConnectionFactory aFactory = (QueueConnectionFactory)
              >> >aIC.lookup(
              >> >> p.getProperty("queue.connection.factory.name")
              >> >> );
              >> >> aConnection = aFactory.createQueueConnection();
              >> >> aConnection.start();
              >> >> aSession = aConnection.createQueueSession(
              >> >> true,
              >> >> -1 // doesn't really matter
              >> >> );
              >> >> Queue aQueue = (Queue) aIC.lookup(JNDI_QUEUE_NAME);
              >> >> aReceiver = aSession.createReceiver(aQueue);
              >> >> final QueueSession aQS = aSession;
              >> >> MessageListener aML = new MessageListener() {
              >> >> public void onMessage(Message m) {
              >> >> try {
              >> >> TextMessage aTM = (TextMessage) m;
              >> >> String s = aTM.getText();
              >> >> System.out.println("Text is:\t" + s);
              >> >> int i = Integer.parseInt(s);
              >> >> if (i < 15) {
              >> >> aQS.commit();
              >> >> } else {
              >> >> aQS.rollback();
              >> >> }
              >> >> } catch (JMSException e) {
              >> >> e.printStackTrace();
              >> >> }
              >> >> }
              >> >> };
              >> >> aReceiver.setMessageListener(aML);
              >> >> byte[] b = new byte[1];
              >> >> System.in.read(b);
              >> >> } catch (Exception e) {
              >> >> e.printStackTrace();
              >> >> } finally {
              >> >> try {
              >> >> if (aReceiver != null) {
              >> >> aReceiver.close();
              >> >> }
              >> >> } catch (JMSException e) {}
              >> >> try {
              >> >> if (aSession != null) {
              >> >> aSession.close();
              >> >> }
              >> >> } catch (JMSException e) {}
              >> >> try {
              >> >> if (aConnection != null) {
              >> >> aConnection.stop();
              >> >> aConnection.close();
              >> >> }
              >> >> } catch (JMSException e) {}
              >> >> }
              >> >> }
              >> >> }
              >> >>
              >> >> Here is the properties file:
              >> >> #
              >> >> java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
              >> >> java.naming.provider.url=t3://localhost:7001
              >> >> queue.connection.factory.name=weblogic.jms.ConnectionFactory
              >> >>
              >> >#queue.connection.factory.name=weblogic.jms.MessageDrivenBeanConnectionFacto
              >> >ry
              >> >> #queue.connection.factory.name=transaction_connection_factory_jndi_name
              >> >>
              >> >> Here is the JMSProperties file:
              >> >> package com.malani.jms.resources;
              >> >>
              >> >> public class JMSProperties {
              >> >> }
              >> >>
              >> >> The first time the server is run, it hangs at 16. Messages 17, 18,
              >and
              >> >19
              >> >are
              >> >> not processed. Is this correct behavior:
              >> >> Text is: 0
              >> >>
              >> >> Text is: 1
              >> >>
              >> >> Text is: 2
              >> >>
              >> >> Text is: 3
              >> >>
              >> >> Text is: 4
              >> >>
              >> >> Text is: 5
              >> >>
              >> >> Text is: 6
              >> >>
              >> >> Text is: 7
              >> >>
              >> >> Text is: 8
              >> >>
              >> >> Text is: 9
              >> >>
              >> >> Text is: 10
              >> >>
              >> >> Text is: 11
              >> >>
              >> >> Text is: 12
              >> >>
              >> >> Text is: 13
              >> >>
              >> >> Text is: 14
              >> >>
              >> >> Text is: 15
              >> >>
              >> >> Text is: 16
              >> >>
              >> >>
              >> >> What happened to message 17, 18, and 19?
              >> >>
              >> >> Now, if I stop the server, and start it again, I see the requequing
              >and
              >> >redelivery
              >> >> of the messages as shown below:
              >> >> Text is: 15
              >> >>
              >> >> Text is: 16
              >> >>
              >> >> Text is: 17
              >> >>
              >> >> Text is: 18
              >> >>
              >> >> Text is: 19
              >> >>
              >> >> Text is: 15
              >> >>
              >> >> Text is: 17
              >> >>
              >> >> Text is: 16
              >> >>
              >> >> Text is: 18
              >> >>
              >> >> Text is: 19
              >> >>
              >> >> Text is: 15
              >> >>
              >> >> Text is: 17
              >> >>
              >> >> Text is: 16
              >> >>
              >> >> Text is: 18
              >> >>
              >> >> Text is: 19
              >> >>
              >> >> Text is: 17
              >> >>
              >> >> Text is: 18
              >> >>
              >> >> Text is: 19
              >> >>
              >> >>
              >> >> Is there some optimization going on?
              >> >>
              >> >> Thank you so much....
              >> >>
              >> >>
              >> >
              >> >
              >
              

  • Cleanup log running transactions ..rollback segments

    Is there any metric in OEM which does the following...
    Am trying to read the document and find the metric which does the following ..not having much luck...
    #* Description : Process to monitor and notify DBA about any in-doubt
    #* transaction which is holding ROLLBACK Segment and
    #* troubling system resources for longer time.
    Thank you

    Below are more details on what it does...trying to find if any metric in OEM does this...thank you
    $sql_text  = "select c.USN  ";
       $sql_text .= ",d.name       ";
       $sql_text .= ",c.EXTENTS , ";
       $sql_text .= "a.username , a.osuser , a.sid , a.process, a.status  ";
       $sql_text .= ",b.start_time ";
       $sql_text .= ",b.status trans_stat, b.used_ublk*value as Bytes_Used ";
       $sql_text .= ",b.used_urec  as Records_used          ";
       $sql_text .= ",start_uext   as First_Extent          ";
       $sql_text .= ",a.MACHINE           ";
       $sql_text .= ",a.TERMINAL        ";
       $sql_text .= ",a.PROGRAM     ";
       $sql_text .= "from v\$session     a,                        ";
       $sql_text .= "     v\$transaction b,                        ";
       $sql_text .= "     v\$rollname    d,                        ";
       $sql_text .= "     (select value from v\$parameter          ";
       $sql_text .= "          where name = 'db_block_size' )  e , ";
       $sql_text .= "     v\$rollstat    c ,                       ";
       $sql_text .= "     dba_rollback_segs f                      ";
       $sql_text .= "where b.ses_addr = a.saddr (+)                ";
       $sql_text .= " and c.usn      = b.xidusn (+)                ";
       $sql_text .= " and d.usn      = c.usn                       ";
       $sql_text .= " and f.segment_id = c.usn                     ";
       $sql_text .= " and a.status     = 'INACTIVE'                ";
       $sql_text .= " and b.used_urec <=${rec_used}                ";
       $sql_text .= " and (round((sysdate - to_date(start_time,'mm/dd/yy HH24:mi:ss'))*1440)) >= ${time_interval} ";
       $sql_text .= " and a.username  <>  'DMIRROR'  

  • Transfer Object Pattern and Concurrency Transaction Mgmt

    I am developing an application that implements a remote rich client. For
    performance reasons I have chosen to use the Transfer Object pattern. I
    have been very successful with this from a performance standpoint, it
    really paid off. I am using it in combination with an assembler pattern
    to construct Transfer Objects for the view and to also reassemble domain
    objects based on changes made to transfer objects on my client side.
    Anyways the only problem I am having with it is I can't seem to figure
    out how I should implement optimistic locking with it. Is there a best
    practices to handle transaction control here?
    I generally try to keep visibility of stale data down, but there are still
    situations where concurrent clients could have requested to edit the same
    the Transfer Object at the same time. I would ideally like to handle this
    using a flavor of optimistic locking. I in fact have implemented
    optimistic locking on the domain side, but now I am not sure how or if I
    should integrate this into the Transfer Object or View side. The version
    field used in optimistic locking is generally a hidden field. The only
    way I can see to handle this with the view side is to expose this field on
    the Domain Objects and actually store it into assembeled transfer objects.
    This seems like it may be a bad idea from a design standpoint.
    The problem is the client requests data and it assembled and delivered to the client. Then at some later time the client may send a request to the server to update this data. At this time a new transaction must be started where the server reloads the domain data and copies over the requested changes. Since the domain data was just loaded you wouldn't ever trigger a versioning problem unless the version was maintained on the transfer object and copied over as well. I am developing this project with hibernate on the back end and unfortunately hibernate doesn't acknowledge manual changes to the version field.
    I just feel like there must be a better way to do this. I believe that using the Transfer Object or DTO pattern for remote client/server architectures is pretty common. So there must be a best practice to deal with concurrency? Suggestions, insight, lay it on me please.
    thx

    I personal respect both concepts and am using both in an application I am currently work.
    Firstly, I have my Transfer Object which I call xxxData.
    Next, the entities are called xxx
    I have my DAO classes that handles all CRUD operation. but within the DAO class I have two methods
    private <EntityClass> retrieveEntityFromObject(<EntityClassData> data) {}
    private <EntityClassData> retrieveEntityFromObject(<EntityClass> entity) {}so with these methods, I separate my business logic from my data layer. My codes will alway use data objects instead of entities. For example, a create method will be
    public ProductData createProduct(ProductData data)
         entity.persist(retrieveEntityFromObject(data));
    }I hope someone understands
    Regards

  • Invoice and Payment in transaction with rollback

    Hi,
    I want to create a payment and an invoice in one scenario step as a synchronous WS call.
    If I create the payment first, then the invoice, how can I roll back the payment if the invoice fails?
    Thanks,
    Jon

    Hi Gordon,
    I mean that if I successfully add the invoice, but for whatever reason the payment fails to add.
    If I was coding this in c# I would start a company transaction, add the invoice, add the payment and then commit the transaction.  If there was a problem adding the payment I would expect the transaction to roll back.
    Is there a way I can wrap the two document creations into a company transaction with B1if?
    Regards,
    Jon

  • Transaction Mgmt. Code In Servlet Filter

    Hi,
    It it possible to write Transaction management code in the Servlet filter. I am confused on this isssue, as "Designing Enterprise Applications with the J2EETM Platform, Second Edition" under section "8.5 Web Tier Transaction Guidelines" says that you can not use transaction management code in the Servlet Filters. But if adventure builder sample has code which uses transaction management code inside the servlet filter named as "Transaction Filter".
    Regards,
    Manish

    Hi,
    The paragraph you quote just implies that it is not guaranteed to work under the 'standard' J2EE servers like your everyday appserver. This is because the specs just don't require it. But different products may have different ideas;-)
    Best,
    Guy
    http://www.atomikos.com

  • Forcing a specific rollback segment on a transaction does not seem to work

    Hi!
    We're using Oracle 9.2.0.5.0 on Sun Solaris and we're still configured to use Rollback Segments.
    We have an issue with Snapshot too old due to RBS too small on a long query I attach below for reference:
    set heading off
    set pagesize 0
    set feedback off
    set linesize 200
    <<<<< SET TRANSACTION USE ROLLBACK SEGMENT UMF_RBS_LARGE_TRAN; <<<<<
    SELECT ucms_cards.msisdn
    || ';;' || to_char(to_date(substr(ucms_cards.notes,14+length(ucms_cards.msisdn),19),'MM-DD-YYYY.HH24-MI-SS'),'DD/MM/YYYY HH24:MI:SS')
    || ';;' || to_char(ucms_batches.expiry_date,'dd/mm/yyyy')
    || ';;' || ucms_cards.serial_no
    || ';;' || ucms_cards.serial_no
    || ';;' || ucms_cards.batch_serial_no
    || ';;' || ' '
    || ';;' || CASE ucms_cards.card_status
    WHEN 'used' THEN '1'
    ELSE '0'
    END
    || ';;' || CASE WHEN date_booked_in is null THEN '01/01/1970 00:00:00' ELSE to_char(date_booked_in,'DD/MM/YYYY') || ' 00:00:00' END
    || ';;' || ' '
    from ucms_batches,ucms_cards, UCMS_EVENT_LOG
    WHERE ucms_cards.batch_serial_no = ucms_batches.serial_no
    AND ucms_cards.serial_no = substr(UCMS_EVENT_LOG.ENTITY_ID,11,length(UCMS_EVENT_LOG.ENTITY_ID)-9)
    AND UCMS_EVENT_LOG.PARTY_NO in (0)
    AND UCMS_EVENT_LOG.TIMESTAMP>=TO_TIMESTAMP(TO_CHAR(SYSDATE-1, 'DD-MM-YYYY') || ' 00:00:01', 'DD-MM-YYYY HH24:MI:SS')
    AND UCMS_EVENT_LOG.TIMESTAMP<=TO_TIMESTAMP(TO_CHAR(SYSDATE-1, 'DD-MM-YYYY') || ' 23:59:59', 'DD-MM-YYYY HH24:MI:SS')
    AND UCMS_EVENT_LOG.USER_ID LIKE 'SCP-AGENT1%'
    AND UCMS_EVENT_LOG.EVENT_TYPE_ID IN (1,2)
    AND UCMS_EVENT_LOG.ENTITY_TYPE_ID LIKE 'ucms_cards%'
    UNION
    SELECT ucms_imported_cards.msisdn
    || ';;' || to_char(to_date(substr(ucms_imported_cards.notes,14+length(ucms_imported_cards.msisdn),19),'MM-DD-YYYY.HH24-MI-SS'),'DD/MM/YYYY H24:MI:SS')
    || ';;' || to_char(ucms_imported_cards.expiry_date,'dd/mm/yyyy')
    || ';;' || ucms_imported_cards.serial_no
    || ';;' || ucms_imported_cards.serial_no
    || ';;' || DBMS_UTILITY.GET_HASH_VALUE(ucms_imported_cards.card_type,1,65536)
    || ';;' || ' '
    || ';;' || CASE ucms_imported_cards.card_status
    WHEN 'used' THEN '1'
    ELSE '0'
    END
    || ';;' || '01/01/1970 00:00:00'
    || ';;' || ' '
    from ucms_imported_cards, UCMS_EVENT_LOG
    where ucms_imported_cards.serial_no = substr(UCMS_EVENT_LOG.ENTITY_ID,11,length(UCMS_EVENT_LOG.ENTITY_ID)-9)
    AND UCMS_EVENT_LOG.PARTY_NO in (0)
    AND UCMS_EVENT_LOG.TIMESTAMP>=TO_TIMESTAMP(TO_CHAR(SYSDATE-1, 'DD-MM-YYYY') || ' 00:00:01', 'DD-MM-YYYY HH24:MI:SS')
    AND UCMS_EVENT_LOG.TIMESTAMP<=TO_TIMESTAMP(TO_CHAR(SYSDATE-1, 'DD-MM-YYYY') || ' 23:59:59', 'DD-MM-YYYY HH24:MI:SS')
    AND UCMS_EVENT_LOG.USER_ID LIKE 'SCP-AGENT1%'
    AND UCMS_EVENT_LOG.EVENT_TYPE_ID LIKE '2%'
    AND UCMS_EVENT_LOG.ENTITY_TYPE_ID LIKE 'ucms_imported_cards%';
    As you see we forced the session to use a huge RBS created for the purpose, but strangely after a long while the query fails with a RBS too small failure due to another RBS, not the one specified.
    Is there any chance the UNION or any other component of the query is implicitly opening a new transaction with a different RBS associated?
    Any chance to force the same RBS specified explicitly?
    Thanks!
    Mike

    albertone wrote:
    but strangely after a long while the query fails with a RBS too small failure due to another RBS, not the one specified.You misunderstand snapshot too old. It can be caused by other sessions same as by your session. Assume AFTER your session issued select some other session modified one (or more) tables ucms_batches, ucms_cards, UCMS_EVENT_LOG and committed changes. By the time your select reaches to fetch rows modified by that other session rollback extents in rollback segment used by that other session were reused. You will get snapshot too old. Bottom line - all sessions modifying table(s) used by your select must use rollback segments large enough so they are not overwritten before corresponding rows are needed by your select.
    SY.

Maybe you are looking for