Bugs item #588806, was opened at 2002-07-30 15: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: Open
Resolution: None
Priority: 5
Submitted By: Frederik Sauer (fredsa)
Assigned to: Nobody/Anonymous (nobody)
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.

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

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: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to