0 Replies Latest reply on Jun 13, 2013 11:39 AM by van.halbert

    Teiid hibernate-on-top-of-teiid quick start

    van.halbert

      Hibernate implemented an enhancement a while back to improve its batch processing of updates by creating a temp table (HT_<tablename>) in the data source.   The table its trying to create for this quickstart is:  create table HT_ProductInfo (id integer not null, hib_sess_id CHAR(36))

       

      There are 2 issues with this:

       

      1.  The quickstart specifies:  hibernate.hbm2ddl.auto=validate that no CREATE/DROP statements are issued to Teiid, however it appears hibernate isn't honoring it for this temp table creation, so you see the following message in the server log:

       

      14:37:54,655 WARN  [org.teiid.PROCESSOR] (ServerService Thread Pool -- 52) TEIID30020 Processing exception for request PdOL0P3YYKUO.0 'TEIID31100 Parsing error: Encountered "create [*]table[*] HT_ProductInfo (" at line 1, column 8.

      Was expecting: "foreign" | "local" | "procedure" | "trigger" | "virtual"'. Originally QueryParserException QueryParser.java:214. Enable more detailed logging to see the entire stacktrace.

       

      I've asked the question in the Hibernate forum if there is a another setting (similar to validate) that would turn off this create statement submittal (https://forum.hibernate.org/viewtopic.php?f=1&t=1026683) or is this a bug in Hibernate (I think the later), but waiting for an answer.

       

      Also, I've updated the dynamicvdb-datafederation quick start, for which this hibernate quick start depends, to create this temp table when the sql DDL script is run to set the schema.

       

       

      2.  If Hibernate now requires the temp table, this will mean Teiid will need to document a requirement when the TeiidDialect is used, that the temp table will need to be created on the source.  However, maybe there's a better option in Teiid to define an internal temp table that hibernate could read/write to.