Examples of SessionFactory


Examples of org.ggf.drmaa.SessionFactory

import org.ggf.drmaa.Session;
import org.ggf.drmaa.SessionFactory;

public class Howto3_1 {
   public static void main(String[] args) {
      SessionFactory factory = SessionFactory.getFactory();
      Session session = factory.getSession();
     
      try {
         session.init("");
         JobTemplate jt = session.createJobTemplate();
         jt.setRemoteCommand("sleeper.sh");
View Full Code Here

Examples of org.ggf.drmaa.SessionFactory

    private static Session session = null;
   
    public static void main(String[] args) throws Exception {
        String jobPath = args[0];
       
        SessionFactory factory = SessionFactory.getFactory();
       
        session = factory.getSession();
        session.init(null);
       
        JobTemplate jt = createJobTemplate(jobPath, 5, true);
       
        List allJobIds = new LinkedList();
View Full Code Here

Examples of org.hibernate.SessionFactory

      config.add(createBaseNamedElement(Environment.TRANSACTION_MANAGER_STRATEGY, TransactionManagerLookupImpl.class.getName()));
      config.add(createBaseNamedElement(Environment.USER_TRANSACTION, JTATransactionFactory.DEFAULT_USER_TRANSACTION_NAME));
      testee.setConfigurationElements(config);
      testee.start();
     
      SessionFactory factory = testee.getInstance();
      assertTrue(factory instanceof SessionFactoryImplementor);
      Settings settings = ((SessionFactoryImplementor) factory).getSettings();
      assertTrue(settings.getTransactionFactory() instanceof JTATransactionFactory);
      assertTrue(settings.isSecondLevelCacheEnabled());
     
View Full Code Here

Examples of org.hibernate.SessionFactory

      assertTrue(testee.isScanForMappingsEnabled());
      assertEquals(MockInterceptor.class.getName(), testee.getSessionFactoryInterceptor());
      assertEquals(MockListenerInjector.class.getName(), testee.getListenerInjector());
     
      // Where we can, validate stuff exposed by hibernate Settings
      SessionFactory factory = testee.getInstance();
      assertTrue(factory instanceof SessionFactoryImplementor);
      Settings settings = ((SessionFactoryImplementor) factory).getSettings();
     
//      assertEquals(TestableHibernate.class.getSimpleName() + testCount, settings.getSessionFactoryName());
      assertEquals(HSQLDialect.class.getName(), testee.getDialect());
View Full Code Here

Examples of org.hibernate.SessionFactory

    return parameters;
  }

  private static Session createSession()
  {
    SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
   
    return sessionFactory.openSession();
  }
View Full Code Here

Examples of org.hibernate.SessionFactory

        // Initialize the Hibernate session factory.
        ServiceRegistryBuilder serviceRegistryBuilder = new ServiceRegistryBuilder().applySettings(hbmConfig.getProperties());
        ServiceRegistry serviceRegistry = (ServiceRegistry) ReflectionUtils.invokeMethod(serviceRegistryBuilder, "buildServiceRegistry", null);
        if (serviceRegistry == null) serviceRegistry = (ServiceRegistry) ReflectionUtils.invokeMethod(serviceRegistryBuilder, "build", null);
        SessionFactory factory = hbmConfig.buildSessionFactory(serviceRegistry);
        hibernateSessionFactoryProvider.setSessionFactory(factory);

        // Set the default schema if specified via system property or via hibernate configuration.
        // NOTE: To set the default schema via hibernate configuration, the hibernate.cfg.xml file must be modified.
        //       This file is located inside the generated webapp. So, if the user wants to change the working schema,
View Full Code Here

Examples of org.hibernate.SessionFactory

   */
  private void tryBoot(String configurationResourceName) {
    Configuration cfg = new OgmConfiguration();
    cfg.setProperty( OgmProperties.DATASTORE_PROVIDER, "infinispan" );
    cfg.setProperty( InfinispanProperties.CONFIGURATION_RESOURCE_NAME, configurationResourceName );
    SessionFactory sessionFactory = cfg.buildSessionFactory();
    if ( sessionFactory != null ) {
      try {
        // trigger service initialization, and also verifies it actually uses Infinispan:
        InfinispanTestHelper.getProvider( sessionFactory );
      }
      finally {
        sessionFactory.close();
      }
    }
  }
View Full Code Here

Examples of org.hibernate.SessionFactory

      {
         sessionFactory_ = SecurityHelper.doPrivilegedAction(new PrivilegedAction<SessionFactory>()
         {
            public SessionFactory run()
            {
               SessionFactory factory = conf_.buildSessionFactory();
               new SchemaUpdate(conf_).execute(false, true);
               return factory;
            }
         });
      }
View Full Code Here

Examples of org.hibernate.SessionFactory

                                }
                            }
                        }

                        ServiceRegistry serviceRegistryBuilder = new StandardServiceRegistryBuilder().applySettings(hibernateConfiguration.getProperties()).build();
                        SessionFactory sessionFactory = hibernateConfiguration.buildSessionFactory(serviceRegistryBuilder);
                        return new HibernateSessionManager(sessionFactory);
                    }
                })
                .in(Scopes.SINGLETON);
    }
View Full Code Here

Examples of org.hibernate.SessionFactory

   
    if (configuration==null) {
      throw new WireException("couldn't find configuration");
    }
   
    SessionFactory sessionFactory = configuration.buildSessionFactory();
   
    wireContext.addListener(new SessionFactoryCloser(sessionFactory));

    return sessionFactory;
  }
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.