Bugs item #856196, was opened at 2003-12-08 14:53
Message generated for change (Comment added) made by loubyansky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=856196&group_id=22866

Category: JBossCMP
Group: v3.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Rafal Kedziorski (rafciom)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: Problems with created SQL queries ...

Initial Comment:
hi,

I am slowly frustrated with all the newest JBoss versions.

After there are some bugs in JBoss 3.2.3 I downloaded
today the actual version from cvs (3.2.4RC1), copiled
this and started our application. After login first
query dailed with this exception:

2003-12-08 13:23:40,546 DEBUG
[net.magix.ejb.media.sessionbeans.MediaBean]
getAllMediaItemVOForAlbum() 3 media found in
album 4
2003-12-08 13:23:40,578 ERROR
[net.magix.ejb.media.sessionbeans.MediaBean]
getAllMediaItemVOForAlbum() failed with Finde
rException
javax.ejb.FinderException: Find failed:
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 synt
ax to use near 'OF t0_o.media_file_id,
t0_o.media_file_id, t0_o.media_id, t0_o."
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:238)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:111)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:38)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:579)
        at
org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:311)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.jav
a:322)
        at
org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:613)
        at
sun.reflect.GeneratedMethodAccessor37.invoke(Unknown
Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1043)
        at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
        at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:197)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:
214)
        at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
        at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:89)
        at
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
        at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
        at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:349)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:98)
        at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)
        at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
        at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
        at
org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:483)
        at
org.jboss.ejb.Container.invoke(Container.java:720)
        at
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:293)
        at
org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
        at $Proxy68.findAllByMediaId(Unknown Source)
        at
net.magix.ejb.media.sessionbeans.MediaBean.getAllMediaItemVOForAlbum(MediaBean.java:832)
        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.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)

        at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)

        at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:349)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
        at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
        at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
        at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at
org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
        at
org.jboss.ejb.Container.invoke(Container.java:700)
        at
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:375)
        at
org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
        at $Proxy183.getAllMediaItemVOForAlbum(Unknown
Source)
        at
net.magix.ejb.media.sessionbeans.MediaFacadeBean.getAllMediaItemVOForAlbum(MediaFacadeBean.java:278)
        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.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)

        at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)

        at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
        at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
        at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
        at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at
org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
        at
org.jboss.ejb.Container.invoke(Container.java:700)
        at
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:375)
        at
org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
        at $Proxy184.getAllMediaItemVOForAlbum(Unknown
Source)
        at
net.magix.web.test.TestPPAServlet.album(TestPPAServlet.java:647)
        at
net.magix.web.test.TestPPAServlet.controller(TestPPAServlet.java:265)
        at
net.magix.web.test.TestPPAServlet.doGet(TestPPAServlet.java:182)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:356)
        at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
        at
org.mortbay.http.HttpContext.handle(HttpContext.java:1723)
        at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:514)
        at
org.mortbay.http.HttpContext.handle(HttpContext.java:1673)
        at
org.mortbay.http.HttpServer.service(HttpServer.java:879)
        at org.jboss.jetty.Jetty.service(Jetty.java:459)
        at
org.mortbay.http.HttpConnection.service(HttpConnection.java:783)
        at
org.mortbay.http.ajp.AJP13Connection.handleNext(AJP13Connection.java:273)
        at
org.mortbay.http.HttpConnection.handle(HttpConnection.java:800)
        at
org.mortbay.http.ajp.AJP13Listener.handleConnection(AJP13Listener.java:204)
        at
org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
        at
org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:454)

This query will be generated:

SELECT
    t0_o.media_file_id,
    t0_o.media_file_id,
    t0_o.media_id,
    t0_o.media_file_quality_id,
    t0_o.codec_id,
    t0_o.class_id,
    t0_o.filename,
    t0_o.filesize,
    t0_o.width,
    t0_o.height FROM media_file t0_o
WHERE
    (t0_o.media_id = 22) FOR UPDATE
OF
    t0_o.media_file_id,
    t0_o.media_file_id,
    t0_o.media_id,
    t0_o.media_file_quality_id,
    t0_o.codec_id,
    t0_o.class_id,
    t0_o.filename,
    t0_o.filesize,
    t0_o.width,
    t0_o.height


And this will be generated by JBoss 3.2.2:

SELECT
    t0_o.media_file_id,
    t0_o.media_id,
    t0_o.media_file_quality_id,
    t0_o.codec_id,
    t0_o.class_id,
    t0_o.filename,
    t0_o.filesize,
    t0_o.width,
    t0_o.height
FROM
    media_file t0_o
WHERE
    (t0_o.media_id = 16)

An this is our EntityBean definition:

/**
 * Description of the Class
 *
 * @author    Rafal Kedziorski
 * @version   $Id: Media_FileBean.java,v 1.6 2003/12/03
09:22:39 rafal Exp $
 * @ejb.bean
 *       name = "Media_FileBean"
 *       description = "Media File Entity Bean"
 *       display-name = "Media File Entity Bean"
 *       local-jndi-name = "media/Media_FileBean"
 *       view-type = "local"
 *       type = "CMP"
 *       cmp-version = "2.x"
 *       schema = "media_file"
 *       primkey-field = "media_file_id"
 *
 * @ejb.finder
 *       view-type = "local"
 *       signature = "java.util.Collection
findAllByMediaId(java.lang.Long media_id)"
 *       query = "SELECT OBJECT(o) FROM media_file o
WHERE o.media_id = ?1"
 *       result-type-mapping = "Local"
 *
 * @ejb.security-identity
 *       use-caller-identity = "true"
 *
 * @ejb.transaction
 *       type = "Mandatory"
 *
 * @jboss.persistence
 *       row-locking = "true"
 *       list-cache-max = "10000"
 *       table-name = "media_file"
 *
 * @jboss.table-name
 *       table-name = "media_file"
 *
 * @jboss.container-configuration
 *       name = "Standard CMP 2.x EntityBean"
 *
 * @jboss.read-ahead
 *       strategy = "on-find"
 *       page-size = "4"
 *       eager-load-group = "*"
 *
 * @jboss.entity-command
 *       name = "mysql-get-generated-keys"
 *
 */
public abstract class Media_FileBean extends
AbstractEntityBean implements EntityBean {

But with other strategy:

*       strategy = "on-load"

it works.


Regards,
Rafal

----------------------------------------------------------------------

>Comment By: Alexey Loubyansky (loubyansky)
Date: 2003-12-08 21:29

Message:
Logged In: YES 
user_id=543482

Fixed in Branch_3_2 and HEAD. Thanks.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=856196&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to