Examples of JABTransaction


Examples of org.jboss.narayana.blacktie.jatmibroker.jab.JABTransaction

    double[] balances = new double[2];
    balances[0] = 1.1;
    balances[1] = 2.2;
    dos.setDoubleArray("balances", balances);

    JABTransaction transaction = new JABTransaction(jabSession, 5000);
    jabService.call(transaction);
    transaction.commit();

    JABMessage response = jabService.getResponse();
    byte[] expected = new byte[60];
    System.arraycopy("tpcall_x_c_type".getBytes(), 0, expected, 0, 15);
    byte[] received = response.getByteArray("X_OCTET");
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.jab.JABTransaction

    log.debug("resume control");
    if (hasTransactionManager()) {
      Transaction tx = controlToTx(ior);
      tm.resume(tx);
    } else {
      JABTransaction transaction = new JABTransaction(ior);
      JABTransaction.resume(transaction);
    }
  }
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.jab.JABTransaction

   */
  public static String getTransactionIOR()
      throws org.omg.CORBA.SystemException, SystemException, Unavailable {
    log.debug("getTransactionIOR");

    JABTransaction curr = JABTransaction.current();
    if (curr != null) {
      log.debug("have JABTransaction");
      return curr.getControlIOR();
    } else if (hasTransaction()) {
      log.debug("have tx mgr");
      Transaction tx = tm.getTransaction();
      log.debug("have arjuna tx");
      TransactionImple atx = (TransactionImple) tx;
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.jab.JABTransaction

  public void test_tpcall_x_octet_with_tx() throws Exception {
    log.debug("JABTestCase::test_tpcall_x_octet_with_tx");
    runServer.tpadvertisetpcallXOctet();
    JABSessionAttributes jabSessionAttributes = new JABSessionAttributes();
    JABSession jabSession = new JABSession(jabSessionAttributes);
    JABTransaction transaction = new JABTransaction(jabSession, 5000);
    JABServiceInvoker jabService = new JABServiceInvoker(
        RunServer.getServiceNametpcallXOctet(), jabSession, "X_OCTET",
        null);
    jabService.getRequest().setByteArray("X_OCTET",
        "test_tpcall_x_octet".getBytes());
    log.debug("calling tpcall_x_octet with tx");
    jabService.call(transaction);
    log.debug("called tpcall_x_octet with tx, commiting ...");
    transaction.commit();
    log.debug("tpcall_x_octet commit ok");
    byte[] expected = new byte[60];
    System.arraycopy("tpcall_x_octet".getBytes(), 0, expected, 0, 14);
    byte[] received = jabService.getResponse().getByteArray("X_OCTET");
    assertTrue(Arrays.equals(expected, received));
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.jab.JABTransaction

  public void test_tpcall_x_octet_commit_tx_rollback_only() throws Exception {
    log.debug("JABTestCase::test_tpcall_x_octet_commit_tx_rollback_only");
    runServer.tpadvertisetpcallXOctet();
    JABSessionAttributes jabSessionAttributes = new JABSessionAttributes();
    JABSession jabSession = new JABSession(jabSessionAttributes);
    JABTransaction transaction = new JABTransaction(jabSession, 5000);
    JABServiceInvoker jabService = new JABServiceInvoker(
        RunServer.getServiceNametpcallXOctet(), jabSession, "X_OCTET",
        null);
    transaction.rollback_only();
    jabService.getRequest().setByteArray("X_OCTET",
        "test_tpcall_x_octet".getBytes());
    jabService.call(transaction);
    try {
      transaction.commit();
      fail("committing a tx marked rollback only succeeded");
    } catch (JABException e) {
      // the exception is expected, but:
      // exception should be CORBA::CORBA::TRANSACTION_ROLLEDBACK but
      // JBossTM
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.jab.JABTransaction

      throws Exception {
    log.debug("JABTestCase::test_tpcall_x_octet_rollback_tx_rollback_only");
    runServer.tpadvertisetpcallXOctet();
    JABSessionAttributes jabSessionAttributes = new JABSessionAttributes();
    JABSession jabSession = new JABSession(jabSessionAttributes);
    JABTransaction transaction = new JABTransaction(jabSession, 5000);
    JABServiceInvoker jabService = new JABServiceInvoker(
        RunServer.getServiceNametpcallXOctet(), jabSession, "X_OCTET",
        null);
    transaction.rollback_only();
    jabService.getRequest().setByteArray("X_OCTET",
        "test_tpcall_x_octet".getBytes());
    jabService.call(transaction);
    try {
      transaction.rollback();
    } catch (JABException e) {
      fail("rolling back a tx marked rollback through exception: "
          + e.getMessage());
    }
    byte[] expected = new byte[60];
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.jab.JABTransaction

  public void test_tpcall_x_octet_suspend_tx() throws Exception {
    log.debug("JABTestCase::test_tpcall_x_octet_suspend_tx");
    runServer.tpadvertisetpcallXOctet();
    JABSessionAttributes jabSessionAttributes = new JABSessionAttributes();
    JABSession jabSession = new JABSession(jabSessionAttributes);
    JABTransaction transaction = new JABTransaction(jabSession, 5000);
    JABServiceInvoker jabService = new JABServiceInvoker(
        RunServer.getServiceNametpcallXOctet(), jabSession, "X_OCTET",
        null);
    jabService.getRequest().setByteArray("X_OCTET",
        "test_tpcall_x_octet".getBytes());
    jabService.call(transaction);
    transaction.commit();
    byte[] expected = new byte[60];
    System.arraycopy("tpcall_x_octet".getBytes(), 0, expected, 0, 14);
    byte[] received = jabService.getResponse().getByteArray("X_OCTET");
    assertTrue(Arrays.equals(expected, received));
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.jab.JABTransaction

    double[] balances = new double[2];
    balances[0] = 1.1;
    balances[1] = 2.2;
    dos.setDoubleArray("balances", balances);

    JABTransaction transaction = new JABTransaction(jabSession, 5000);
    jabService.call(transaction);
    transaction.commit();

    JABMessage response = jabService.getResponse();
    byte[] expected = new byte[60];
    System.arraycopy("tpcall_x_c_type".getBytes(), 0, expected, 0, 15);
    byte[] received = response.getByteArray("X_OCTET");
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.jab.JABTransaction

        X_OCTET rcvd = (X_OCTET) response.getBuffer();
        String responseData = new String(rcvd.getByteArray());
        log.info("TxCreateService response: " + responseData);

        // check that the remote service created a transaction
        JABTransaction tx = JABTransaction.current();
        if (tx != null) {
          try {
            tx.commit();
          } catch (JABException e) {
            args = "Service create a transaction but commit failed: "
                + e;
            log.error(args, e);
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.