Hello Ionel,

it is a limitation. I guess, the generated SQL spans two datasources.
Hence, it can't be executed. You should use the same datasource.

alex

Tuesday, July 29, 2003, 10:36:08 AM, Ionel Gardais wrote:

IG> Hi,

IG> I am facing a strange problem with CMR.
IG> Here is the background :

IG> I have some tables and the corressponding EJBs

IG> BusinessUnit
IG> ------------
IG> idTeam
IG> idProject

IG> Project
IG> -------
IG> *id
IG> name
IG> version

IG> Team
IG> ----
IG> id

IG> Team2Managers
IG> ------------
IG> idTeam
IG> idPerson

IG> Team2Members
IG> -------------
IG> idTeam
IG> idPerson

IG> Person
IG> ------
IG> *id
IG> name
IG> surname
IG> login


IG> All the tables EXCEPT Person are stored under the datasource java:/QualiteDS
IG> Person is stored under the java;/BaseTestDS datasource

IG> The java:/QualiteDS is specified as the default datasource for all beans.
IG> the java:/BaseTestDS is set only for bean Person (overriding the default 
IG> java:/QualiteDS datasource ?)

IG> [EMAIL PROTECTED] and Team2Members are the relation tables for the M:N 
IG> relationship between a Team and its Members/Managers


IG> In order to retrieve the list of Projects a Person works in, I have 
IG> declared the following query :

IG>  * @ejb.finder
IG>  *  signature="java.util.Collection 
IG> findProjectsByTeamMember(java.lang.String user)"
IG>  *  query="SELECT DISTINCT bu.project FROM BusinessUnitEJB bu, 
IG> IN(bu.team.managers) managers, IN(bu.team.members) members WHERE 
IG> managers.login = ?1 OR members.login = ?1 ORDER BY bu.project.name, 
IG> bu.project.version"
IG>  *  result-type-mapping="Local"
IG>  *
IG>  * @jboss.query
IG>  *  signature="java.util.Collection 
IG> findProjectsByTeamMember(java.lang.String user)"
IG>  *  query="SELECT DISTINCT bu.project FROM BusinessUnitEJB bu, 
IG> IN(bu.team.managers) managers, IN(bu.team.members) members WHERE 
IG> managers.login = ?1 OR members.login = ?1 ORDER BY bu.project.name, 
IG> bu.project.version"




IG> The problem is that I get an exception when I call this method :

IG> *16:45:53,443 ERROR [STDERR] javax.ejb.FinderException: Find failed: 
IG> java.sql.SQLException: General error,  message from server: "Table 
IG> 'Qualite.Person' doesn't exist"*
IG> 16:45:53,447 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:194)
IG> 16:45:53,448 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:91)
IG> 16:45:53,449 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
IG> 16:45:53,449 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:599)
IG> 16:45:53,449 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:324)
IG> 16:45:53,455 ERROR [STDERR]     at 
IG> 
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:323)
IG> 16:45:53,455 ERROR [STDERR]     at 
IG> org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:603)
IG> 16:45:53,456 ERROR [STDERR]     at 
IG> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
IG> 16:45:53,456 ERROR [STDERR]     at 
IG> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
IG> 16:45:53,456 ERROR [STDERR]     at 
IG> 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
IG> 16:45:53,457 ERROR [STDERR]     at 
IG> java.lang.reflect.Method.invoke(Method.java:324)
IG> 16:45:53,457 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:998)
IG> 16:45:53,458 ERROR [STDERR]     at 
IG> org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
IG> 16:45:53,458 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:188)
IG> 16:45:53,458 ERROR [STDERR]     at 
IG> 
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
IG> 16:45:53,459 ERROR [STDERR]     at 
IG> org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
IG> 16:45:53,462 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:91)
IG> 16:45:53,463 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
IG> 16:45:53,463 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
IG> 16:45:53,464 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
IG> 16:45:53,464 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
IG> 16:45:53,464 ERROR [STDERR]     at 
IG> org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:74)
IG> 16:45:53,465 ERROR [STDERR]     at 
IG> org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)
IG> 16:45:53,465 ERROR [STDERR]     at 
IG> org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
IG> 16:45:53,466 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
IG> 16:45:53,466 ERROR [STDERR]     at 
IG> org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:477)
IG> 16:45:53,466 ERROR [STDERR]     at 
IG> org.jboss.ejb.Container.invoke(Container.java:694)
IG> 16:45:53,467 ERROR [STDERR]     at 
IG> 
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:272)
IG> 16:45:53,467 ERROR [STDERR]     at 
IG> org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
IG> 16:45:53,468 ERROR [STDERR]     at 
IG> $Proxy248.findProjectsByTeamMember(Unknown Source)



IG> As you can see, the query looks for a Person table under the 
IG> java:/QualiteDS whereas I override it in the bean persistence declaration.
IG> Also, when the bean are deployed, the container says :

IG> 16:39:19,573 INFO  [PersonEJB] Table 'Person' already exists

IG> And this table is under the java:/BaseTestDS (which is a good thing and 
IG> somewhat prove that the Person bean is using the java:/BaseTestDS 
IG> instead of the default java:/QualiteDS


IG> Any hints ?
IG> I am totaly lost with this thing.


IG> Thanks you very much
IG> ionel



IG> -------------------------------------------------------
IG> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
IG> Data Reports, E-commerce, Portals, and Forums are available now.
IG> Download today and enter to win an XBOX or Visual Studio .NET.
IG> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
IG> _______________________________________________
IG> JBoss-user mailing list
IG> [EMAIL PROTECTED]
IG> https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to