1 Reply Latest reply on May 5, 2009 12:10 AM by Arbi Sookazian

    XA datasource with SQL Server - SQL Error: 156

    Wolfgang Bergbauer Newbie

      Hi all

      I configured two datasources for my seam application one to Oracle 10 and one to SQLSErver2005. After using seam-gen to generate entities and list pages for a view on the SQL Server, I am getting the fllowing error from SQLServer:
      SQL Error: 156, SQLState: S0001

      The query has invalid syntax for MSSQL. Is there any additional setting I need to change to get this simple query formatted correctly?

      17:25:10,664 INFO  [STDOUT] Hibernate: 
              top 26 clientconf0_.Conference Name as Conference1_36_,
              clientconf0_.FMNO as FMNO36_,
              clientconf0_.Client Name as Client3_36_,
              clientconf0_.ConferenceRef as Conferen4_36_,
              clientconf0_.UsesCPIN as UsesCPIN36_,
              clientconf0_.UsesMPIN as UsesMPIN36_,
              clientconf0_.Conference Status as Conference7_36_ 
              ClientConferenceStatus clientconf0_
      17:25:10,965 WARN  [JDBCExceptionReporter] SQL Error: 156, SQLState: S0001
      17:25:10,965 ERROR [JDBCExceptionReporter] Incorrect syntax near the keyword 'as'.

      My persistencen unit:

         <persistence-unit name="AudioConferenceMsSql">
               <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
               <property name="hibernate.hbm2ddl.auto" value="none"/>
               <property name="hibernate.show_sql" value="true"/>
               <property name="hibernate.format_sql" value="true"/>
               <property name="jboss.entity.manager.factory.jndi.name" value="java:/AudioConferenceEntityManagerFactoryMsSql"/>


      I would have posted on the Hibernate forum, but I do not know when this ever will come back.

      Thanks all for any hints,