13 Replies Latest reply: Jun 18, 2012 10:23 PM by Steven Hawkins RSS

    TEIID30499 No sources were given for the model "XYZ"

    Nabeel Ahmed Newbie

      HI,

      I have created a VDB for Northwind database on Teiid-8.0.0.Final, JBoss-as-7.1.1.Final and SQL Server 2008.

      VDB deployed successfully, i able to query data, all select queries are working fine.

      But when i tried to create/update a record i got error as metioned below:

       

      Caused by: TEIID30499 No sources were given for the model Northwind

              at org.teiid.dqp.internal.process.CachedFinder.findCapabilities(CachedFinder.java:95) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.query.metadata.TempCapabilitiesFinder.findCapabilities(TempCapabilitiesFinder.java:61) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.query.optimizer.relational.rules.CriteriaCapabilityValidatorVisitor.canPushLanguageObject(CriteriaCapabilityValidatorVisitor.java:680) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.query.optimizer.relational.rules.CriteriaCapabilityValidatorVisitor.canPushLanguageObject(CriteriaCapabilityValidatorVisitor.java:666) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.query.optimizer.relational.RelationalPlanner.addNestedProcedure(RelationalPlanner.java:615) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.query.optimizer.relational.RelationalPlanner.createUpdatePlan(RelationalPlanner.java:533) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.query.optimizer.relational.RelationalPlanner.generatePlan(RelationalPlanner.java:497) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:180) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:188) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:429) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.dqp.internal.process.PreparedStatementRequest.generatePlan(PreparedStatementRequest.java:154) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.dqp.internal.process.Request.processRequest(Request.java:449) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:534) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:278) [teiid-engine-8.0.0.Final.jar:8.0.0.Final]

              ... 8 more

       

      NOTE: if i remove view model from vdb and only create vdb with source model then create/update works fine.

       

      Please find the VDB in attachments...

       

      Am i missing anything?

      any Help?

       

      regards,

      Nabeel Ahmed

        • 1. Re: TEIID30499 No sources were given for the model "XYZ"
          Ramesh Reddy Master

          Some reason the the above indicates that view model is being viewed as source model. Will investigate  and let you know.

           

          Ramesh..

          • 2. Re: TEIID30499 No sources were given for the model "XYZ"
            Ramesh Reddy Master

            Nabeel,

             

            I found regression in the 8.0 code, I logged https://issues.jboss.org/browse/TEIID-2047

             

            Also, if you use this VDB against Teiid 7.7, you also need to set the view table as "updatable" in the Designer.

             

            Thanks

             

            Ramesh..

            • 3. Re: TEIID30499 No sources were given for the model "XYZ"
              Nabeel Ahmed Newbie

              Hi Ramesh,

               

              How can i find this fix, which build and when?

              • 4. Re: TEIID30499 No sources were given for the model "XYZ"
                Ramesh Reddy Master

                Nabeel,

                 

                The code is checked on the trunk/master branch. Check out these directions for doing a build for yourself.

                 

                Ramesh..

                • 5. Re: TEIID30499 No sources were given for the model "XYZ"
                  Nabeel Ahmed Newbie

                  Hi Ramesh,

                   

                  I downloaded the updated version Teiid-8.1.Alpha2 Build on June 13, 2012, the above mentioned issue has been resolved now.

                  But i am still not able to Create/Update records

                   

                  This time i got this error:

                   

                   

                  Internal Exception: org.teiid.jdbc.TeiidSQLException: TEIID30492 Remote org.teiid.api.exception.query.QueryValidatorException: TEIID30492 TEIID30376 The specified change set [CustomerID, Address, City, CompanyName, ContactName, ContactTitle, Country, Fax, Phone, PostalCode, Region] against an inherently updatable view does not map to a key preserving group.

                  Error Code: 0

                  Call: INSERT INTO "Customers" ("CustomerID", "Address", "City", "CompanyName", "ContactName", "ContactTitle", "Country", "Fax", "Phone", "PostalCode", "Region") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

                          bind => [ID1339585889015, null, null, Company1339585889015, null, null, null, null, null, null, null]

                  Query: InsertObjectQuery({Customers ID1339585889015})

                          at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.processExceptionForCommError(DatabaseAccessor.java:1494) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:838) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:906) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:592) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:535) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1717) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:253) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:342) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:162) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:177) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:472) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:287) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:844) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:743) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2871) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1516) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1498) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1449) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:224) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:123) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:3799) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1415) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:636) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1505) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:267) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1143) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84) [eclipselink-2.3.2.jar:2.3.2.v20111125-r10461]

                          ... 42 more

                   

                  Do i need to change anything in VDB or missing anything?

                   

                  regards,

                   

                  Nabeel

                  • 6. Re: TEIID30499 No sources were given for the model "XYZ"
                    Ramesh Reddy Master

                    Nabeel,

                     

                    You need to set Table as "updatable" in the table properties and also make sure al the columns are set to "updatable" too. The error indicates as such.

                     

                    Thanks

                     

                    Ramesh..

                    • 7. Re: TEIID30499 No sources were given for the model "XYZ"
                      Steven Hawkins Master

                      That error may also indicate that the primary key for the underlying table isn't completely covered by the insert as well.  What does the view definition for Customers look like and is there a primary key for the target table?

                       

                      Steve

                      • 8. Re: TEIID30499 No sources were given for the model "XYZ"
                        Nabeel Ahmed Newbie

                        i  rechecked the model, every table and their columns are updatable.

                        And primary keys are properly defined. Customer table has primary key of type string, and most of other tables have primary keys autoincreament.

                        Every thing was working on teiid release prior to 8.x.

                        The problem is still there.

                         

                        regards,

                        Nabeel Ahmed

                        • 9. Re: TEIID30499 No sources were given for the model "XYZ"
                          Steven Hawkins Master

                          Nabeel,

                           

                          Just to make sure we're on the same page, Customer is a view that is marked as updatable correct?  Can you provide what you have as the view definition for Customer?  And any associated primary keys for the tables involved in that view?

                           

                          Steve

                          • 10. Re: TEIID30499 No sources were given for the model "XYZ"
                            Nabeel Ahmed Newbie

                            Hi Steve,

                             

                            Yes Customer and all of its columns are marked as updatable.

                             

                            Please find the source and view model in attachments.

                             

                            regards,

                            Nabeel

                            • 11. Re: TEIID30499 No sources were given for the model "XYZ"
                              Ramesh Reddy Master

                              Nabeel,

                               

                              I believe this is a regression, can you open a JIRA

                               

                              I see in the code that checks updatable columns names aginst defined columns on the table is failing to find the correct match.

                               

                              Thanks

                               

                              Ramesh..

                              • 12. Re: TEIID30499 No sources were given for the model "XYZ"
                                Nabeel Ahmed Newbie

                                HI Ramesh,

                                 

                                i have opened a JIRA

                                https://issues.jboss.org/browse/TEIID-2076

                                 

                                Please let us know when this got fix.

                                 

                                regards,

                                 

                                Nabeel Ahmed

                                • 13. Re: TEIID30499 No sources were given for the model "XYZ"
                                  Steven Hawkins Master

                                  Nabeel,

                                   

                                  Hopefully you got the JIRA email, but just to make sure this has been resolved on trunk.  We'll be releasing an alpha 2 this week that includes the fix.

                                   

                                  Thanks,

                                  Steve