0 Replies Latest reply on Apr 8, 2003 12:24 AM by Andrew McConnell

    CMR SQL generation on remove() syntax invalid

    Andrew McConnell Newbie

      I have a table (nfl_player) whose PK is referenced by a FK in another table (fantasy_team_player). When I call "nfl_player.remove()" in my session bean, I get the following SQL exception. This problem exists under both 3.2RC3 and 3.2RC4.

      I don't see any defects or other reports of this. Does anyone have any suggestions? I'm so close to productivity that it hurts! Thanks all.

      00:19:09,033 DEBUG [NflPlayer] Executing SQL: SELECT FROM fantasy_team_player WHERE (nfl_player_id=?)
      00:19:09,137 ERROR [LogInterceptor] TransactionRolledbackLocalException, causedBy:
      java.sql.SQLException: Syntax error or access violation, message from server: "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 'FROM fantasy_team_player WHERE (nfl_player_id=25)' at line 1"
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1628)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:886)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:945)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:1809)
      at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1458)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:289)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.execute(JDBCLoadRelationCommand.java:101)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadRelation(JDBCStoreManager.java:709)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.load(JDBCCMRFieldBridge.java:1034)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.getInstanceValue(JDBCCMRFieldBridge.java:547)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.removeFromRelations(JDBCRemoveEntityCommand.java:129)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:69)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreManager.java:701)
      at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:518)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.removeEntity(CachedConnectionInterceptor.java:431)
      at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:497)
      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.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1032)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:95)
      [blah, blah, blah....]