I am am tryign to access two dbs via one slsb, specifically one method within an slsb. However this is not possible ? Other than altering the stored procs is there anything else I could do ?
@PersistenceContext(unitName = "DB1")
private EntityManager oneEntityManager;
@PersistenceContext(unitName = "DB2")
private EntityManager twoEntityManager;
...
StringBuilder queryString1 = new StringBuilder("exec myProc1 ");
Query queryOne = oneEntityManager.createNativeQuery(queryString.toString());
List<?> resultListOne = query.getResultList();
StringBuilder queryString2 = new StringBuilder("exec myProc2 ");
Query queryTwo = twoEntityManager.createNativeQuery(queryString2.toString());
List<?> resultListTwo = queryTwo.getResultList();
...
causes : org.hibernate.exception.GenericJDBCException: Cannot open connection