Bugs item #588806, was opened at 2002-07-30 16:33
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=588806&group_id=22866

Category: JBossCMP
Group: v3.0 Rabbit Hole
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Frederik Sauer (fredsa)
Assigned to: Dain Sundstrom (dsundstrom)
Summary: new PostgreSQL locate() broken

Initial Comment:
In 3.0.1RC1 the locate() function for PostgreSQL is:
(CASE position(?1 in substring(?2 from ?3)) WHEN 0 THEN
0 ELSE position(?1 in substring(?2 from ?3)) + ?3 - 1 END)

An exmaple ejb-ql statement to reproduce the problem is:
SELECT OBJECT(a) FROM Account a WHERE LOCATE(?1,
a.externalDesignator) > 0

The the jboss log you find:
Executing SQL: SELECT t0_a.ACCOUNT_ID FROM account t0_a
WHERE (CASE position(? in
substring(t0_a.EXTERNAL_DESIGNATOR from 1)) WHEN 0 THEN
0 ELSE position(? in substring(t0_a.EXTERNAL_DESIGNATOR
from 1)) + 1 - 1 END) > 0
DEBUG [findByExtDesWithNoAuth] Find failed
No value specified for parameter 2.
        at
org.postgresql.jdbc2.PreparedStatement.compileQuery(PreparedStatement.java:130)
        at
org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.java:99)
        at
org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeQuery(LocalPreparedStatement.java:289)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:107)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:549)
        at
org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:348)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:323)
        at
org.jboss.ejb.EntityContainer.find(EntityContainer.java:662)
        at
sun.reflect.GeneratedMethodAccessor184.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:1116)
        at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
        at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:209)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
        at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:88)
        at
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
        at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
        at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:176)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
        at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:104)
        at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:118)
        at
org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
        at org.jboss.ejb.Container.invoke(Container.java:726)
        at
org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
        at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
        at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
        at
sun.reflect.GeneratedMethodAccessor31.invoke(Unknown
Source)
        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:536)


The cause I assume is that the prepared SQL statement
has two '?'s, but is only being passed one copy of the
the parameter.

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

>Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-08-30 00:24

Message:
Logged In: YES 
user_id=251431

Fixed in HEAD, Branch_3_2, and Branch_3_0.  This should fix
a bunch of errors with EJB-QL functions and parameters.

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

Comment By: Frederik Sauer (fredsa)
Date: 2002-08-24 00:12

Message:
Logged In: YES 
user_id=111914

Yes, I was just able to reproduce this in 3.0.1.

The stack trace now looks like this:

javax.ejb.FinderException: Find failed: No value specified
for parameter 2.

        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:143)

        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)

        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:549)

        at
org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:348)

        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:323)

        at org.jboss.ejb.EntityContainer.find(EntityContainer.java:662)

        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.invokeHome(EntityContainer.java:1116)

        at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)

        at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:209)

        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)

        at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:88)

        at
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)

        at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)

        at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)

        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)

        at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)

        at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)

        at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)

        at
org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)

        at org.jboss.ejb.Container.invoke(Container.java:729)

        at
org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)

        at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)

        at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:370)

        at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)

        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:536)

        at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)

        at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)

        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)

        at
org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown
Source)

        at
org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)

        at
org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)

        at
org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)

        at
org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)

        at
org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198)

        at
org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)

        at $Proxy2.findByExternalDesignatorWithNoAuth(Unknown Source)

        at
com.cctus.client.FredInitializerClient.<init>(FredInitializerClient.java:513)

        at
com.cctus.client.FredInitializerClient.main(FredInitializerClient.java:82)



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

Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-08-23 19:15

Message:
Logged In: YES 
user_id=251431

Is this still broken in 3.0.1?

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

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


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to