2 Replies Latest reply on Aug 7, 2012 1:53 PM by shawkins

    Issue with  materialized views

    manoj.m.agarwal

      Hi,

       

      I am using Teiid 8.1.0Beta2.

      I am creating dynamic VDB and in one of the models,I am using materialized views.I am setting model type as "VIRTUAL" on ModelMetaData object.

       

      modelMetaData.setModelType(Type.VIRTUAL);

       

      In my custome translator for materilaized view i set this

       

      table.setMaterialized(true);

      table.setVirtual(true);

       

      while deploying VDB i get this error...

       

       

      org.teiid.deployers.VirtualDatabaseException: TEIID40094 No metadata repository of type null defined for model xyz_metadata for VDB xyz.1"}}}}

      ........................

      ........................

      ........................

       

      Caused by: org.teiid.adminapi.AdminProcessingException: TEIID70006 {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.teiid.vdb.xyz.1" => "org.jboss.msc.service.StartException in service jboss.teiid.vdb.xyz.1: org.teiid.deployers.VirtualDatabaseException: TEIID40094 No metadata repository of type null defined for model xyz_metadata for VDB xyz.1"}}}}

                      at org.teiid.adminapi.AdminFactory$AdminImpl.execute(AdminFactory.java:435)

                      at org.teiid.adminapi.AdminFactory$AdminImpl.deploy(AdminFactory.java:563)

       

      Can someone please provide some input to fix it ?

       

      Thanks !
      Manoj

        • 1. Re: Issue with  materialized views
          rareddy

          Manoj,

           

          Only "PHYSICAL" models can be backed by a Translator based metadata. i.e. Custom translators can only define the metadata for the PHYSICAL models, not VIRTUAL models. If your model is PHYSICAL then setting below will work

           

          {code:lang=JAVA}

          modelMetaData.setSchemaSourceType("NATIVE");

          {code}

           

          Now some background

           

          Teiid defines two different types of in-built Metadata Repositories,

          * NATIVE - Load from Translator works for PHYSICAL models

          * DDL - Metadata is presented in the DDL form, works for both PHYSICAL and VIRTUAL models

           

          Alternatively, User also has flexibility to define their own custom MetadataRepository for metadata loading purposes. See https://docs.jboss.org/author/display/TEIID/Custom+Metadata+Repository

           

          So, if you want to provide metadata for for your VIRTUAL model, then you have two choices.

          # Provide the metadata in the form of DDL

          # Write a custom metadata repository as defined in the above link.

           

          Ramesh..

          1 of 1 people found this helpful
          • 2. Re: Issue with  materialized views
            shawkins

            Manoj,

             

            This is somewhat related to https://community.jboss.org/message/752276https://issues.jboss.org/browse/TEIID-2136 will allow virtual entries on a physical model, which can be backed by your translator.  That is in trunk and will be in 8.1 CR1.

             

            Steve