[jboss-user] [Persistence] - Re: how to create PersistenceUnit and map to dataSource prog

2009-12-10 Thread javatwo
Why is there such limitation? From programming API, it just overrides the property declared in persistence.xml. For BEAN management type, do we need to implement any transation related methods? We use JBoss 5.1.0 GA. Thanks for help. View the original post :

[jboss-user] [Persistence] - Re: how to create PersistenceUnit and map to dataSource prog

2009-12-10 Thread javatwo
We tried, but got exception: 08:17:58,204 ERROR [STDERR] javax.persistence.PersistenceException: [PersistenceUnit: defaultDataSource] Unable to build EntityManagerFactory 08:17:58,205 ERROR [STDERR] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)

[jboss-user] [Persistence] - Re: how to create PersistenceUnit and map to dataSource prog

2009-11-23 Thread getaceres
Unfortunately, you cannot use a JTA datasource unless you get the entity managers by injection, so you cannot use the jta-data-source element and you have to set the javax.persistence.nonJtaDataSource property in the map. Also, if you are using EJBs, you have to add the

[jboss-user] [Persistence] - Re: how to create PersistenceUnit and map to dataSource prog

2009-11-22 Thread javatwo
Thanks for help. If one peristence unit is mapped to many data sources(with same tables), is there any problems with Hibernate caching? We tried the following in a stateless session bean: Map configOverrides = new HashMap(); EntityManagerFacotry emf =

[jboss-user] [Persistence] - Re: how to create PersistenceUnit and map to dataSource prog

2009-11-22 Thread javatwo
From debugging, the issue seems to be in method: PersistenceUnitDeployment.start(); which is in the jar jboss-jpa-deployer.jar. Where can I find the source code for the jar? I could not find it under http://anonsvn.jboss.org/repos/ Thanks! View the original post :

[jboss-user] [Persistence] - Re: how to create PersistenceUnit and map to dataSource prog

2009-11-22 Thread javatwo
the previous message is for deploy phase. I was wrong. From further debug, the exception is thrown in SessionFactoryImp.java throw new HibernateException(The chosen transaction strategy requires access to the JTA TransactionManager); if ( settings.getTransactionManagerLookup()!=null ) {

[jboss-user] [Persistence] - Re: how to create PersistenceUnit and map to dataSource prog

2009-11-20 Thread getaceres
I have the same problem as you. I need to use different databases with the same tables in the same application (the difference is that for me is that redeploying or even restarting JBoss is permitted, but in this case, it doesn't matter). The idea is to use the same persistence unit changing

[jboss-user] [Persistence] - Re: how to create PersistenceUnit and map to dataSource prog

2009-11-19 Thread getaceres
The only solution that I've found is to create the Entity Managers (and factories) through the Persistence.createEntityManagerFactory method passing it a Map with the JNDI direction of the new datasource. You can also pass the datasource connection information by hibernate properties in the

[jboss-user] [Persistence] - Re: how to create PersistenceUnit and map to dataSource prog

2009-11-19 Thread javatwo
Thanks for help. Is the persistence unit name required to be defined in a persistence.xml? what is the property name for data source in the map? Thanks! Dave View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4266681#4266681 Reply to the post :