-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: SQL error getting objects declared by union-subclass
PostPosted: Tue Apr 26, 2005 12:38 pm 
Newbie

Joined: Wed Apr 06, 2005 12:30 am
Posts: 7
A quick summary of the problem before all of the required elements are included:

Base1 has some common fields on it and is abstract

Super1 derives from Base1, is abstract, has some fields.

Super2 derives from Base1 and is not abstract, has some other fields

Sub1 derives from Super1 and has no new fields, just different functionality

Sub2 derives from Super1 (note - not a typo - both Sub1 and Sub2 derive from Super1) and has no new fields, just different functionality

Super1 and Super2 are <union-subclassed> to Base1. Base1 is declared abstract

in the mapping file.

Sub1 and Sub2 are <subclassed> to Super1.

Using these mappings, I get two tables:

Super1, and Super2, with all of the expected fields on them.

When I create Sub1 and Sub2 instances, they get persisted to the Super1 table. When I attempt to get them using Criteria API, I get a "you have an error in your SQL syntax" Exception.

One very interesting behavior is that during creation of the objects, the objectType discriminator column does not get populated at all, which is strange, because it will have no way of differentiating between Sub1 and Sub2, and will just bring them back as Super1.

I can mail the actual source code that causes this if necesary.

I can get around the problem currently by just making Super1 and Super2 completely different hierarchies and give up any polymorphism between the two, but that's not a desirable long-term solution.

Thanks!

Hibernate version:
3.0.1, inside JBoss 4.0.1sp1

Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="test">
   <class name="Base1" abstract="true">
      <id name="id" type="long" column="systemId">
           <generator class="hilo"/>
      </id>

      <discriminator type="string" column="objectType"/>
      <property name="createDate"/>
      <property name="createUserId"/>
   </class>
   <filter-def name="versionFilter">
      <filter-param name="asOfTranNum" type="long"/>
   </filter-def>      
</hibernate-mapping>

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="test">
   <union-subclass name="Super1" extends="Base1">
      <property name="dataItem1"/>
      <property name="dataItem2"/>
   </union-subclass>
</hibernate-mapping>

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="test">
   <union-subclass name="Super2" extends="Base1">
      <property name="differentDataItem"/>
   </union-subclass>
</hibernate-mapping>

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="test">
   <subclass name="Sub1" extends="Super1">
   </subclass>
</hibernate-mapping>

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="test">
   <subclass name="Sub2" extends="Super1">
   </subclass>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
Code:
        Super1 one = new Sub1();
        Super1 two = new Sub2();
        one.setCreateUserId(new Long(1));
        two.setCreateUserId(new Long(2));
        s.save(one);
        s.save(two);
        Super2 three = new Super2();
        s.save(three);

In a different session:
Code:
        List list = s.createCriteria(Super1.class).list();

Full stack trace of any exception that occurs:
Code:
11:43:01,521 WARN  [JDBCExceptionReporter] SQL Error: 1064, SQLState: 42000
11:43:01,521 ERROR [JDBCExceptionReporter] You have an error in your SQL syntax.  Check the manual that corresponds to y
our MySQL server version for the right syntax to use near 'select dataItem2, objectType, createUserId, createDate, syste
mI
11:43:01,551 ERROR [LogInterceptor] RuntimeException in method: public abstract java.lang.Object com.adaptivegroupware.s
erver.requestdispatcher.RequestDispatcherRemote.dispatch(com.adaptivegroupware.server.request.Request) throws java.rmi.R
emoteException:
org.hibernate.exception.SQLGrammarException: could not execute query
        at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.loader.Loader.doList(Loader.java:1525)
        at org.hibernate.loader.Loader.list(Loader.java:1505)
        at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1256)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:299)
        at com.adaptivegroupware.gs.console.requests.TestSubCreationRequest.execute(TestSubCreationRequest.java:35)
        at com.adaptivegroupware.server.requestdispatcher.RequestDispatcherBean.dispatch(RequestDispatcherBean.java:55)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
        at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)

        at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:113
)
        at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
        at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
        at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
        at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:122)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
        at org.jboss.ejb.Container.invoke(Container.java:870)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
        at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
        at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
        at sun.rmi.transport.Transport$1.run(Transport.java:148)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL
server version for the right syntax to use near 'select dataItem2, objectType, createUserId, createDate, systemI
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2376)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2297)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1860)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1705)
        at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:296)
        at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:118)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:1204)
        at org.hibernate.loader.Loader.doQuery(Loader.java:368)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:208)
        at org.hibernate.loader.Loader.doList(Loader.java:1522)
        ... 46 more

Name and version of the database you are using:
MySQL 4.0.28

The generated SQL (show_sql=true):
Code:
select this_.systemId as systemId0_, this_.createDate as createDate0_0_, this_.createUserId as createUs4_0_0_, this_.dataItem1 as dataItem1_2_0_, this_.dataItem2 as dataItem2_2_0_, this_.clazz_ as clazz_0_ from ( select dataItem2, objectType, createUserId, createDate, systemId, dataItem1, 1 as clazz_ from Super1 union select dataItem2, objectType, createUserId, createDate, systemId, dataItem1, 3 as clazz_ from Super1 union select dataItem2, objectType, createUserId, createDate, systemId, dataItem1, 4 as clazz_ from Super1 ) this_


Debug level Hibernate log excerpt:
Code:
12:18:53,491 DEBUG [SessionFactoryObjectFactory] JNDI lookup: hibernate/SessionFactory
12:18:53,491 DEBUG [SessionFactoryObjectFactory] lookup: uid=8a808185037f4c6401037f4c677a0000
12:18:53,541 DEBUG [JDBCContext] successfully registered Synchronization
12:18:53,541 DEBUG [SessionImpl] opened session at timestamp: 4565124437979136
12:18:53,541 DEBUG [DefaultSaveOrUpdateEventListener] saving transient instance
12:18:53,551 DEBUG [AbstractSaveEventListener] generated identifier: , using strategy: org.hibernate.id.IdentityGenerato
r
12:18:53,551 DEBUG [AbstractSaveEventListener] saving [com.adaptivegroupware.server.versioning.TransactionEntry#<null>]
12:18:53,551 DEBUG [AbstractSaveEventListener] executing insertions
12:18:53,562 DEBUG [BasicEntityPersister] Inserting entity: com.adaptivegroupware.server.versioning.TransactionEntry (na
tive id)
12:18:53,562 DEBUG [AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
12:18:53,562 DEBUG [AbstractBatcher] opening JDBC connection
12:18:53,562 DEBUG [SQL] insert into TransactionEntry values ( )
12:18:53,562 INFO  [STDOUT] Hibernate: insert into TransactionEntry values ( )
12:18:53,562 DEBUG [AbstractBatcher] preparing statement
12:18:53,582 DEBUG [BasicEntityPersister] Dehydrating entity: [com.adaptivegroupware.server.versioning.TransactionEntry#
<null>]
12:18:53,582 DEBUG [IdentifierGeneratorFactory] Natively generated identity: 1
12:18:53,582 DEBUG [AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
12:18:53,582 DEBUG [AbstractBatcher] closing statement
12:18:53,582 DEBUG [AbstractBatcher] closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets:
0, globally: 0)
12:18:53,592 DEBUG [DefaultSaveOrUpdateEventListener] saving transient instance
12:18:53,592 DEBUG [TransactionHelper] surrounding tx suspended
12:18:53,592 DEBUG [AbstractBatcher] opening JDBC connection
12:18:53,632 DEBUG [AbstractBatcher] closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets:
0, globally: 0)
12:18:53,632 DEBUG [TransactionHelper] surrounding tx resumed
12:18:53,632 DEBUG [TableHiLoGenerator] new hi value: 0
12:18:53,632 DEBUG [AbstractSaveEventListener] generated identifier: 1, using strategy: org.hibernate.id.TableHiLoGenera
tor
12:18:53,632 DEBUG [AbstractSaveEventListener] saving [test.Sub1#1]
12:18:53,642 DEBUG [DefaultSaveOrUpdateEventListener] saving transient instance
12:18:53,642 DEBUG [AbstractSaveEventListener] generated identifier: 2, using strategy: org.hibernate.id.TableHiLoGenera
tor
12:18:53,642 DEBUG [AbstractSaveEventListener] saving [test.Sub2#2]
12:18:53,642 DEBUG [DefaultSaveOrUpdateEventListener] saving transient instance
12:18:53,642 DEBUG [AbstractSaveEventListener] generated identifier: 3, using strategy: org.hibernate.id.TableHiLoGenera
tor
12:18:53,642 DEBUG [AbstractSaveEventListener] saving [test.Super2#3]
12:18:53,642 DEBUG [AbstractBatcher] opening JDBC connection
12:18:53,642 DEBUG [JDBCContext] successfully registered Synchronization
12:18:53,642 DEBUG [SessionImpl] opened session at timestamp: -9223372036854775808
12:18:53,662 DEBUG [AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
12:18:53,662 DEBUG [SQL] select this_.systemId as systemId0_, this_.createDate as createDate0_0_, this_.createUserId as
createUs4_0_0_, this_.dataItem1 as dataItem1_2_0_, this_.dataItem2 as dataItem2_2_0_, this_.clazz_ as clazz_0_ from ( se
lect dataItem2, objectType, createUserId, createDate, systemId, dataItem1, 1 as clazz_ from Super1 union select dataItem
2, objectType, createUserId, createDate, systemId, dataItem1, 3 as clazz_ from Super1 union select dataItem2, objectType
, createUserId, createDate, systemId, dataItem1, 4 as clazz_ from Super1 ) this_
12:18:53,662 INFO  [STDOUT] Hibernate: select this_.systemId as systemId0_, this_.createDate as createDate0_0_, this_.cr
eateUserId as createUs4_0_0_, this_.dataItem1 as dataItem1_2_0_, this_.dataItem2 as dataItem2_2_0_, this_.clazz_ as claz
z_0_ from ( select dataItem2, objectType, createUserId, createDate, systemId, dataItem1, 1 as clazz_ from Super1 union s
elect dataItem2, objectType, createUserId, createDate, systemId, dataItem1, 3 as clazz_ from Super1 union select dataIte
m2, objectType, createUserId, createDate, systemId, dataItem1, 4 as clazz_ from Super1 ) this_
12:18:53,662 DEBUG [AbstractBatcher] preparing statement
12:18:53,692 DEBUG [AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
12:18:53,692 DEBUG [AbstractBatcher] closing statement
12:18:53,692 DEBUG [AbstractBatcher] closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets:
0, globally: 0)
12:18:53,692 DEBUG [JDBCExceptionReporter] could not execute query [select this_.systemId as systemId0_, this_.createDat
e as createDate0_0_, this_.createUserId as createUs4_0_0_, this_.dataItem1 as dataItem1_2_0_, this_.dataItem2 as dataIte
m2_2_0_, this_.clazz_ as clazz_0_ from ( select dataItem2, objectType, createUserId, createDate, systemId, dataItem1, 1
as clazz_ from Super1 union select dataItem2, objectType, createUserId, createDate, systemId, dataItem1, 3 as clazz_ fro
m Super1 union select dataItem2, objectType, createUserId, createDate, systemId, dataItem1, 4 as clazz_ from Super1 ) th
is_]
java.sql.SQLException: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server ver
sion for the right syntax to use near 'select dataItem2, objectType, createUserId, createDate, systemI
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2376)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2297)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1860)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1705)
        at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:296)
        at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:118)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:1204)
        at org.hibernate.loader.Loader.doQuery(Loader.java:368)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:208)
        at org.hibernate.loader.Loader.doList(Loader.java:1522)
        at org.hibernate.loader.Loader.list(Loader.java:1505)
        at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1256)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:299)
        at com.adaptivegroupware.gs.console.requests.TestSubCreationRequest.execute(TestSubCreationRequest.java:35)
        at com.adaptivegroupware.server.requestdispatcher.RequestDispatcherBean.dispatch(RequestDispatcherBean.java:55)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
        at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)

        at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:113
)
        at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
        at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
        at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
        at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:122)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
        at org.jboss.ejb.Container.invoke(Container.java:870)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
        at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
        at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
        at sun.rmi.transport.Transport$1.run(Transport.java:148)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:534)
12:18:53,692 WARN  [JDBCExceptionReporter] SQL Error: 1064, SQLState: 42000
12:18:53,692 ERROR [JDBCExceptionReporter] You have an error in your SQL syntax.  Check the manual that corresponds to y
our MySQL server version for the right syntax to use near 'select dataItem2, objectType, createUserId, createDate, syste
mI
12:18:53,732 DEBUG [CacheSynchronization] transaction after completion callback, status: 4
12:18:53,732 DEBUG [JDBCContext] after transaction completion
12:18:53,732 DEBUG [SessionImpl] after transaction completion
12:18:53,732 DEBUG [CacheSynchronization] automatically closing session
12:18:53,732 DEBUG [SessionImpl] automatically closing session
12:18:53,732 DEBUG [SessionImpl] closing session
12:18:53,732 DEBUG [AbstractBatcher] closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets:
0, globally: 0)
12:18:53,732 DEBUG [JDBCContext] after transaction completion
12:18:53,732 DEBUG [SessionImpl] after transaction completion
12:18:53,732 DEBUG [CacheSynchronization] transaction after completion callback, status: 4
12:18:53,732 DEBUG [JDBCContext] after transaction completion
12:18:53,732 DEBUG [SessionImpl] after transaction completion
12:18:53,732 DEBUG [CacheSynchronization] automatically closing session
12:18:53,732 DEBUG [SessionImpl] automatically closing session
12:18:53,732 DEBUG [SessionImpl] closing session
12:18:53,732 ERROR [LogInterceptor] RuntimeException in method: public abstract java.lang.Object com.adaptivegroupware.s
erver.requestdispatcher.RequestDispatcherRemote.dispatch(com.adaptivegroupware.server.request.Request) throws java.rmi.R
emoteException:
org.hibernate.exception.SQLGrammarException: could not execute query
        at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.loader.Loader.doList(Loader.java:1525)
        at org.hibernate.loader.Loader.list(Loader.java:1505)
        at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1256)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:299)
        at com.adaptivegroupware.gs.console.requests.TestSubCreationRequest.execute(TestSubCreationRequest.java:35)
        at com.adaptivegroupware.server.requestdispatcher.RequestDispatcherBean.dispatch(RequestDispatcherBean.java:55)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
        at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)

        at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:113
)
        at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
        at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
        at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
        at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:122)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
        at org.jboss.ejb.Container.invoke(Container.java:870)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
        at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
        at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
        at sun.rmi.transport.Transport$1.run(Transport.java:148)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL
server version for the right syntax to use near 'select dataItem2, objectType, createUserId, createDate, systemI
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2376)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2297)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1860)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1705)
        at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:296)
        at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:118)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:1204)
        at org.hibernate.loader.Loader.doQuery(Loader.java:368)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:208)
        at org.hibernate.loader.Loader.doList(Loader.java:1522)
        ... 46 more
12:19:22,904 DEBUG [JDBCContext] running Session.finalize()
12:19:22,904 DEBUG [JDBCContext] running Session.finalize()


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.