Been working on it for quitre some time. this is my config
<dataConfig> <dataSource type="JdbcDataSource" name="ds1" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://...:1433;databaseName=A" user="XX" password="XX" /> <document> <entity name="PackageVersion" pk="PackageVersionId" query= "/*PackageVersion.Query*/ select PackageVersion.Id PackageVersionId, PackageVersion.VersionNumber, CONVERT(char(19), PackageVersion.LastModificationTime ,126) + 'Z' LastModificationTime, Package.Id PackageId, Package.Name PackageName, PackageVersion.Comments PackageVersionComments, Package.CreatedBy CreatedBy from [dbo].[Package] Package inner join [dbo].[PackageVersion] PackageVersion on Package.Id = PackageVersion.PackageId where Package.RecordStatusId=0 and PackageVersion.RecordStatusId=0"> <entity name="PackageTag" pk="ResourceId" processor="CachedSqlEntityProcessor" cacheKey="ResourceId" cacheLookup="PackageVersion.PackageId" query="/*PackageTag.Query*/ select ResourceId,[Text] PackageTag from [dbo].[Tag] Tag Where ResourceType = 0"/> </entity> </document> </dataConfig> Now, this runs in my test env and the only thing I do is change the configuration to another db( and as a result also the schema name from [dbo] to another ) This result in a totally different behavior. In the first configuration the selects were done be this order - inner object and then outer object. which means that the cache works. In the second configuration - over the other db the order was first the outer and then the inner. cache did not work at all. the inner query is not stored at all. What could be the problem?