Package org.exolab.castor.jdo.conf

Examples of org.exolab.castor.jdo.conf.TransactionDemarcation


  {
    load();
   
    try {
      // Load the JDO configuration file from the specified input source.
      TransactionDemarcation transactionDemarcation = JDOConfLoader.getTransactionDemarcation (source, resolver);
       
      if (transactionDemarcation == null)
        throw new TransactionManagerAcquireException ("Problem obtaining transaction manager demarcation configuration");

      String demarcationMode = transactionDemarcation.getMode();
      TransactionManager transactionManager = transactionDemarcation.getTransactionManager();
     
      if (transactionManager == null) {
       
        if (!demarcationMode.equals(LocalTransactionManagerFactory.NAME))
          throw new TransactionManagerAcquireException ("Problem obtaining required transaction manager configuration.");
View Full Code Here


        if (_transactionManagerFactory == null) {
           
            String transactionMode = null;
            try {
                TransactionDemarcation demarcation =
                    JDOConfLoader.getTransactionDemarcation(new InputSource (_jdoConfURI), _entityResolver);
                    
                String demarcationMode =demarcation.getMode();

                org.exolab.castor.jdo.conf.TransactionManager transactionManager = demarcation.getTransactionManager();
                               
                if (transactionManager != null)
                    transactionMode = transactionManager.getName();
                else {
                   
View Full Code Here

   * create a simple TransactionDemarcation configuration with local transaction handling
   * @return simple TransactionDemarcation configuration with local transaction handling
   */
  public static TransactionDemarcation createSimpleTransactionDemarcationConf()
  {
    TransactionDemarcation trans = new TransactionDemarcation();

    trans.setMode("local");
    trans.setTransactionManager(new TransactionManager());

    return trans;
  }
View Full Code Here

        if (_transactionManagerFactory == null) {
           
            String transactionMode = null;
            try {
                TransactionDemarcation demarcation =
                    JDOConfLoader.getTransactionDemarcation(_jdoConfURI, _entityResolver);
                    
                String demarcationMode =demarcation.getMode();

                org.exolab.castor.jdo.conf.TransactionManager transactionManager = demarcation.getTransactionManager();
                               
                if (transactionManager != null)
                    transactionMode = transactionManager.getName();
                else {
                   
View Full Code Here

  }

  public void testGetTransactionDemarcation()
    throws Exception
  {
    TransactionDemarcation transactionDemarcation = JDOConfLoader.getTransactionDemarcation (source, resolver);
    writer.println (transactionDemarcation);
  }
View Full Code Here

  {
    source = new InputSource ("src/examples/jdo/jdo-conf.minimal.xml");
   
    JDOConfLoader.deleteConfiguration();
   
    TransactionDemarcation demarcation = JDOConfLoader.getTransactionDemarcation (source, resolver);
   
    assertNotNull (demarcation);
    assertNull (demarcation.getTransactionManager());
   
  }
View Full Code Here

  {
    source = new InputSource ("src/examples/jdo/jdo-conf.global.jndi.xml");
   
    JDOConfLoader.deleteConfiguration();
   
    TransactionDemarcation demarcation = JDOConfLoader.getTransactionDemarcation (source, resolver);
   
    assertNotNull (demarcation);
    assertEquals (demarcation.getMode(), "global");
    assertNotNull (demarcation.getTransactionManager());
    assertEquals (demarcation.getTransactionManager().getName(), "jndi");
   
  }
View Full Code Here

  {
    source = new InputSource ("src/examples/jdo/jdo-conf.global.jndi.with-params.xml");
   
    JDOConfLoader.deleteConfiguration();
   
    TransactionDemarcation demarcation = JDOConfLoader.getTransactionDemarcation (source, resolver);
   
    assertNotNull (demarcation);
    assertEquals (demarcation.getMode(), "global");
    assertNotNull (demarcation.getTransactionManager());
    assertEquals (demarcation.getTransactionManager().getName(), "jndi");
    assertEquals (demarcation.getTransactionManager().getParamCount(), 1);
   
  }
View Full Code Here

  {
    source = new InputSource ("src/examples/jdo/jdo-conf.missing-demarcation.xml");
   
    JDOConfLoader.deleteConfiguration();
   
    TransactionDemarcation demarcation = JDOConfLoader.getTransactionDemarcation (source, resolver);
   
    assertNull(demarcation);
   
  }
View Full Code Here

TOP

Related Classes of org.exolab.castor.jdo.conf.TransactionDemarcation

Copyright © 2018 www.massapicom. 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.