This content has been marked as final.
Show 5 replies
-
1. Re: Problem with manual flush mode for managed persistence c
pmuir Jul 31, 2007 11:00 AM (in response to nickarls)You need to use a SMPC
-
2. Re: Problem with manual flush mode for managed persistence c
nickarls Jul 31, 2007 3:08 PM (in response to nickarls)"pete.muir@jboss.org" wrote:
You need to use a SMPC
Aah, indeed, thanks. Would I also be getting the SMPC by using the getEntityManager() in EntityHome and the standard PC by using the getPersistenceContext() in PersistenceController? -
3. Re: Problem with manual flush mode for managed persistence c
pmuir Jul 31, 2007 5:29 PM (in response to nickarls)No, both would return an SMPC (getPersistenceContext can also return a Seam managed hibernate session)
-
4. Re: Problem with manual flush mode for managed persistence c
asookazian Dec 18, 2007 2:42 PM (in response to nickarls)Does SMPC work with multiple datasources in the same app? If yes how would you configure the @In injection attribute similar to the @PersistenceContext JPA attribute which you can specify a persistenceUnit name? In the API for the Seam @In annotation there is no element similar to unitName...
@PersistenceContext(unitName="boIcomsSecurityAudit", type=PersistenceContextType.EXTENDED) private EntityManager em; //@In(create=true) //EntityManager em; //a Seam-managed persistence context
I have xyz-ds.xml as below:<datasources> <local-tx-datasource> <jndi-name>boIcomsSecurityAuditDatasource</jndi-name> <connection-url>jdbc:sqlserver://CORG0DV01:1433;databaseName=boIcomsSecurityAudit</connection-url> <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> <user-name>_AppUser_JavaTestAcct</user-name> <password>JavaTestAcct</password> </local-tx-datasource> <local-tx-datasource> <jndi-name>coxDSSDatasource</jndi-name> <connection-url>jdbc:sqlserver://CORG0DV01:1433;databaseName=coxDSS</connection-url> <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> <user-name>_AppUser_JavaTestAcct</user-name> <password>JavaTestAcct</password> </local-tx-datasource> <local-tx-datasource> <jndi-name>coxIMDatasource</jndi-name> <connection-url>jdbc:sqlserver://CORG0DV01:1433;databaseName=coxIM</connection-url> <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> <user-name>_AppUser_JavaTestAcct</user-name> <password>JavaTestAcct</password> </local-tx-datasource> </datasources>
-
5. Re: Problem with manual flush mode for managed persistence c
pmuir Dec 19, 2007 5:12 PM (in response to nickarls)You would set up multiple entity manager components in components.xml like
<persistence:managed-persistence-context name="entityManager1" persistence-unit-jndi-name="java:/EntityManagerFactory1" /> <persistence:managed-persistence-context name="entityManager2" persistence-unit-jndi-name="java:/EntityManagerFactory2" />
@In EntityManager entityManager1; @In EntityManager entityManager2;