Hi all,
I have am having a problem with a cross-model relationship. Here's the relationship
LotCode <->> ExternalLotCode
LotCode is in one EOModel and ExternalLotCode is in another. The EOModels are for two different databases, which may or may not be running on the same DB server. I've tested it both ways and have the same problems.
When I search for ExternalLotCodes by specifying values for attributes that exist on LotCode, I get an Invalid object name 'dbo.Lot_Code' error, which is the right table name, but it is looking in the wrong DB for it. The FROM clause of the SQL sent to the DB (ROM dbo.MSDynamics_Lot_Code t0, dbo.Lot_Code T1 ) shows that it is trying to create a join between tables in different DBs which is not going to work.
I've done other cross-db relationships that have worked. Why isn't this one? Any guesses?
Dave
[1] Dec 02 05:08:22 BakeryManagementJavaClient[59421] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Begin Internal Transaction Dec 02 05:08:22 BakeryManagementJavaClient[59421] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.MicrosoftPlugIn$MicrosoftExpression: "SELECT t0.External_Lot_Code_ID, t0.External_Lot_Code_Value, t0.External_Part_Number, t0.Lot_Code_ID FROM dbo.MSDynamics_Lot_Code t0, dbo.Lot_Code T1 WHERE (UPPER(T1.Lot_Code_Value) LIKE UPPER(?) ESCAPE '\' AND UPPER(T1.Part_Number) LIKE UPPER(?) ESCAPE '\') AND t0.Lot_Code_ID = T1.Lot_Code_ID" withBindings: 1:"08269%"(lotCodeValue), 2:"03010119140181%"(partNumber)> Dec 02 05:08:22 BakeryManagementJavaClient[59421] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Rollback Internal Transaction Dec 02 05:08:22 BakeryManagementJavaClient[59421] (ERXDatabaseContextDelegate.java:153) INFO er.transaction.adaptor.Exceptions - Database Exception occured: com.webobjects.jdbcadaptor.JDBCAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.MicrosoftPlugIn$MicrosoftExpression: "SELECT t0.External_Lot_Code_ID, t0.External_Lot_Code_Value, t0.External_Part_Number, t0.Lot_Code_ID FROM dbo.MSDynamics_Lot_Code t0, dbo.Lot_Code T1 WHERE (UPPER(T1.Lot_Code_Value) LIKE UPPER(?) ESCAPE '\' AND UPPER(T1.Part_Number) LIKE UPPER(?) ESCAPE '\') AND t0.Lot_Code_ID = T1.Lot_Code_ID" withBindings: 1:"08269%"(lotCodeValue), 2:"03010119140181%"(partNumber)>: Next exception:SQL State:S0002 -- error code: 208 -- msg: Invalid object name 'dbo.Lot_Code'.
|