In my DS i didnt set the schema.
When the server startup it create a factory based on this persistence unit:
Code:
<persistence>
<persistence-unit name="BRL-Server">
<jta-data-source>java:/InsiteDS</jta-data-source>
<properties>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
<property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.DefaultComponentSafeNamingStrategy" />
</properties>
</persistence-unit>
</persistence>
In run time i create factories like the way you suggested
based on this factory with the schema as a parameter.
My questions are:
1. What is the meaning of the first factory? no schema was set for this factory.
2. How can i avoid from create the first facroty. I dont need it. Is there any API that i can craete a facroty in runtime without the need of base factory
3. the factoy that created is no ManagedFactory , so is used this code is this ok?
Code:
ManagedEntityManagerFactory managedEntityManagerFactory = EntityManagerFactoryMap.getInstance().getManagedEntityManagerFactory(schemaName);
em = new TransactionScopedEntityManager(managedEntityManagerFactory);
Thank you very much.
ps. i am working with JBoss 4.2