RE: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0
Scott, Dain, sorry for having gotten this totally wrong. I was in a bad mood, because I had to change my code, not having the time to wait for a fix. The word 'cool' reminded me of an interview with Bill Gates, that was printed in a local IT magazine, where he answered to the question why so many users of software from Redmond complain about lots of problems: "Because they think it's cool. You can go and tell your colleagues: Been there, done that." (from memory). I really appreciate your work and your product. It's a great achievement. Georg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Scott M Stark Sent: Tuesday, May 14, 2002 16:17 To: 'jboss-user' Subject: Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0 Being 'cool' about the issue meant Dain was fine in supporting the required behavior. There was no implication that the users were idiots. Try reading the mail a little more carefully before deciding you need to rant. Scott Stark Chief Technology Officer JBoss Group, LLC - Original Message - From: "Georg Schmid" <[EMAIL PROTECTED]> To: "'Dain Sundstrom'" <[EMAIL PROTECTED]>; "'Stephen Coy'" <[EMAIL PROTECTED]> Cc: "'jboss-user'" <[EMAIL PROTECTED]> Sent: Monday, May 13, 2002 11:53 PM Subject: RE: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0 > > Dain, > > this is a quite obvious bug (if you ever tried to select on a boolean > EB field backed by an Oracle table), so why are you so cool about it?? > > I have a EB with a mostRecent boolean field, and because of this bug > there is no way to make a custom finder like > > select object(myEB) > from MyEBTable > where myEB.mostRecent = true > > work. > > Please don't get into the habit of thinking your users are idiots... > > --- five lines of additional rant suppressed -- > > Georg > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] On Behalf Of Dain > Sundstrom > Sent: Tuesday, May 14, 2002 07:35 > To: Stephen Coy > Cc: jboss-user > Subject: Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean > comparisons from true and false to 1 and 0 > > > Cool, can you post a bug report, so I don't forget to make the change? > > Thanks, > > -dain > > Stephen Coy wrote: > > > Sorry Dain, > > > > I was trying to point out that not all SQL implementations support > > the use of literal "true" and "false" values. > > > > Therefore, we need to get them mapped to "1" and "0" respectively in > > this situation. > > > > On Tuesday, May 14, 2002, at 02:53 PM, Dain Sundstrom wrote: > > > >> This is like pulling teeth. Just tell me what you want and why, > >> short and sweet. Think 72 words. > >> > >> I should true map to 1 and false to 0 in Oracle, SQLServer and > >> MySQL? I add some more metadata for this. > >> > > > > The short answer is yes. ___ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0
Georg, You read my email wrong. All I wanted to know was that this is a problem for Oracle because it doesn't understand the SQL 92 keywords true and false, and I needed to know what to do about it. I simply can't handle reading 3 pages of text to tell me that we need a 0/1 mapping. I was in San Franscisco all of last week and spent yesterday reading over 1000 emails and postings, so cut me a little slack. Now that there is a but report, this is on my todo list, and I'll get to it when I can. If you want to write a patch, I will be more then happy to apply it. -dain Georg Schmid wrote: > Dain, > > this is a quite obvious bug (if you ever tried to select on a boolean EB > field backed by > an Oracle table), so why are you so cool about it?? > > I have a EB with a mostRecent boolean field, and because of this bug > there is no way > to make a custom finder like > > select object(myEB) > from MyEBTable > where myEB.mostRecent = true > > work. > > Please don't get into the habit of thinking your users are idiots... > > --- five lines of additional rant suppressed -- > > Georg > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] On Behalf Of Dain > Sundstrom > Sent: Tuesday, May 14, 2002 07:35 > To: Stephen Coy > Cc: jboss-user > Subject: Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean > comparisons from true and false to 1 and 0 > > > Cool, can you post a bug report, so I don't forget to make the change? > > Thanks, > > -dain > > Stephen Coy wrote: > > >>Sorry Dain, >> >>I was trying to point out that not all SQL implementations support the >>use of literal "true" and "false" values. >> >>Therefore, we need to get them mapped to "1" and "0" respectively in >>this situation. >> >>On Tuesday, May 14, 2002, at 02:53 PM, Dain Sundstrom wrote: >> >> >>>This is like pulling teeth. Just tell me what you want and why, short >>>and sweet. Think 72 words. >>> >>>I should true map to 1 and false to 0 in Oracle, SQLServer and MySQL? >>>I add some more metadata for this. >>> >>> >>The short answer is yes. >> >> >>___ >> >>Have big pipes? SourceForge.net is looking for download mirrors. We >>supply the hardware. You get the recognition. Email Us: >>[EMAIL PROTECTED] >>___ >>JBoss-user mailing list >>[EMAIL PROTECTED] >>https://lists.sourceforge.net/lists/listinfo/jboss-user >> > > -- x Dain Sundstrom Chief Architect, JBossCMP JBoss Group, LLC x ___ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0
Being 'cool' about the issue meant Dain was fine in supporting the required behavior. There was no implication that the users were idiots. Try reading the mail a little more carefully before deciding you need to rant. Scott Stark Chief Technology Officer JBoss Group, LLC - Original Message - From: "Georg Schmid" <[EMAIL PROTECTED]> To: "'Dain Sundstrom'" <[EMAIL PROTECTED]>; "'Stephen Coy'" <[EMAIL PROTECTED]> Cc: "'jboss-user'" <[EMAIL PROTECTED]> Sent: Monday, May 13, 2002 11:53 PM Subject: RE: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0 > > Dain, > > this is a quite obvious bug (if you ever tried to select on a boolean EB > field backed by > an Oracle table), so why are you so cool about it?? > > I have a EB with a mostRecent boolean field, and because of this bug > there is no way > to make a custom finder like > > select object(myEB) > from MyEBTable > where myEB.mostRecent = true > > work. > > Please don't get into the habit of thinking your users are idiots... > > --- five lines of additional rant suppressed -- > > Georg > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] On Behalf Of Dain > Sundstrom > Sent: Tuesday, May 14, 2002 07:35 > To: Stephen Coy > Cc: jboss-user > Subject: Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean > comparisons from true and false to 1 and 0 > > > Cool, can you post a bug report, so I don't forget to make the change? > > Thanks, > > -dain > > Stephen Coy wrote: > > > Sorry Dain, > > > > I was trying to point out that not all SQL implementations support the > > use of literal "true" and "false" values. > > > > Therefore, we need to get them mapped to "1" and "0" respectively in > > this situation. > > > > On Tuesday, May 14, 2002, at 02:53 PM, Dain Sundstrom wrote: > > > >> This is like pulling teeth. Just tell me what you want and why, short > >> and sweet. Think 72 words. > >> > >> I should true map to 1 and false to 0 in Oracle, SQLServer and MySQL? > >> I add some more metadata for this. > >> > > > > The short answer is yes. ___ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0
Dain, this is a quite obvious bug (if you ever tried to select on a boolean EB field backed by an Oracle table), so why are you so cool about it?? I have a EB with a mostRecent boolean field, and because of this bug there is no way to make a custom finder like select object(myEB) from MyEBTable where myEB.mostRecent = true work. Please don't get into the habit of thinking your users are idiots... --- five lines of additional rant suppressed -- Georg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Dain Sundstrom Sent: Tuesday, May 14, 2002 07:35 To: Stephen Coy Cc: jboss-user Subject: Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0 Cool, can you post a bug report, so I don't forget to make the change? Thanks, -dain Stephen Coy wrote: > Sorry Dain, > > I was trying to point out that not all SQL implementations support the > use of literal "true" and "false" values. > > Therefore, we need to get them mapped to "1" and "0" respectively in > this situation. > > On Tuesday, May 14, 2002, at 02:53 PM, Dain Sundstrom wrote: > >> This is like pulling teeth. Just tell me what you want and why, short >> and sweet. Think 72 words. >> >> I should true map to 1 and false to 0 in Oracle, SQLServer and MySQL? >> I add some more metadata for this. >> > > The short answer is yes. > > > ___ > > Have big pipes? SourceForge.net is looking for download mirrors. We > supply the hardware. You get the recognition. Email Us: > [EMAIL PROTECTED] > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user -- x Dain Sundstrom Chief Architect, JBossCMP JBoss Group, LLC x ___ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0
Cool, can you post a bug report, so I don't forget to make the change? Thanks, -dain Stephen Coy wrote: > Sorry Dain, > > I was trying to point out that not all SQL implementations support the > use of literal "true" and "false" values. > > Therefore, we need to get them mapped to "1" and "0" respectively in > this situation. > > On Tuesday, May 14, 2002, at 02:53 PM, Dain Sundstrom wrote: > >> This is like pulling teeth. Just tell me what you want and why, short >> and sweet. Think 72 words. >> >> I should true map to 1 and false to 0 in Oracle, SQLServer and MySQL? >> I add some more metadata for this. >> > > The short answer is yes. > > > ___ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user -- x Dain Sundstrom Chief Architect, JBossCMP JBoss Group, LLC x ___ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0
Sorry Dain, I was trying to point out that not all SQL implementations support the use of literal "true" and "false" values. Therefore, we need to get them mapped to "1" and "0" respectively in this situation. On Tuesday, May 14, 2002, at 02:53 PM, Dain Sundstrom wrote: > This is like pulling teeth. Just tell me what you want and why, short > and sweet. Think 72 words. > > I should true map to 1 and false to 0 in Oracle, SQLServer and MySQL? I > add some more metadata for this. > The short answer is yes. ___ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0
This is like pulling teeth. Just tell me what you want and why, short and sweet. Think 72 words. I should true map to 1 and false to 0 in Oracle, SQLServer and MySQL? I add some more metadata for this. -dain Stephen Coy wrote: > Oracle does not grok "true" or "false" . It does not have a boolean data > type. > > According to my "SQL in a Nutshell", neither does Microsoft SQL Server > or MySQL. Postgres on the other hand does. > > Consequently standardjbosscmp-jdbc.xml maps booleans in Oracle: > > > java.lang.Boolean > BIT > NUMBER(1) > > > > > On Tuesday, May 14, 2002, at 01:50 PM, Dain Sundstrom wrote: > >> I don't get this. The log says it is executing this query: >> >> SELECT DISTINCT >> t0_bean.a_Boolean, t0_bean.an_Int, t0_bean.a_Long, >> t0_bean.a_Double, t0_bean.a_String >> FROM CMP2ENTITY t0_bean >> WHERE t0_bean.a_Boolean = true >> >> So what is wrong with that where clause? Are there any Oracle DBAs >> out there that can shed some light on to why this query is rejected. >> >> -dain >> >> Stephen Coy wrote: >> >>> Reposted here at Dain's request... >>> Begin forwarded message: >>> Hi All, >>> I think I have found a bug when specifying your own finder method >>> with EJB QL and Oracle. >>> The problem is that in EJB QL any comparisons to a boolean field >>> must be made using the keywords TRUE or FALSE. When I do this I get >>> an exception come back fromOracle telling me it doesn't know the >>> field name. It seems that JBoss is not converting the TRUE or FALSE >>> to a 1 or 0 when it sends the SQL to Oracle, that is, >>> "...wheremyBoolean = true" is being sent to Oracle. >>> I have tried all possible sensible to tags in >>> the XML files. >>> Anyway,I have created a unit test package for this - it is >>> attached. It plugs into the JBoss testsuite. To compile the test, >>> you will need to add the following to the jboss-all/testsuite/build.xml: >>>>> depends="compile, >>>... >>>_jars-dbtest, >>>_jars-findWhereBoolean, >>>... >>>_jars-bankiiop"> >>> >>> >>> >>> >>> >>> >> manifest="${build.etc}/manifest.mf"> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> If you're interested, the actual JBoss server.log error message and >>> stack trace is: >>> 2002-05-13 18:18:45,506 DEBUG >>> >[org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.CMP2Entity.findAllWhereBooleanIsTrue] >>> >>> Executing SQL: SELECT DISTINCT t0_bean.a_Boolean, t0_bean.an_Int, >>> t0_bean.a_Long, t0_bean.a_Double, t0_bean.a_String FROM CMP2ENTITY >>> t0_bean WHERE t0_bean.a_Boolean = true >>> 2002-05-13 18:18:45,516 DEBUG >>> >[org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.CMP2Entity.findAllWhereBooleanIsTrue] >>> >>> Find failed >>> java.sql.SQLException: ORA-00904: invalid column name >>> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180) >>> at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208) >>> at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543) >>> at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1451) >>> at >>> oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:651) >>> >>> at >>> oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2117) >>> >>> at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout >>> (OracleStatement.java:2331) at >>> oracle.jdbc.driver.OraclePreparedStatement.executeUpdate >>> (OraclePreparedStatement.java:422) at >>> oracle.jdbc.driver.OraclePreparedStatement.executeQuery >>> (OraclePreparedStatement.java:366) at >>> org.jboss.resource.adapter.jdbc.local.PreparedStatementInPool.executeQuery( >>> >>> PreparedStatementInPool.java:862) 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:466) at >>> org.jboss.ejb.plugins.CMPPersistenceManager.findEntities >>> (CMPPersistenceManager.java:348) at >>> org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities( >>> >>> CachedConnectionInterceptor.java:284) at >>> org.jboss.ejb.EntityContainer.find(EntityContainer.java:662) >>> at java.lang.reflect.Method.invoke(Native Method) >>> at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome >>> (EntityContainer.java:) at >>> org.jboss.ejb.plugins.AbstractInterceptor.invokeHome >>> (AbstractInterceptor.java:73) at >>> org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome >>> (EntitySynchron
Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0
Oracle does not grok "true" or "false" . It does not have a boolean data type. According to my "SQL in a Nutshell", neither does Microsoft SQL Server or MySQL. Postgres on the other hand does. Consequently standardjbosscmp-jdbc.xml maps booleans in Oracle: java.lang.Boolean BIT NUMBER(1) On Tuesday, May 14, 2002, at 01:50 PM, Dain Sundstrom wrote: > I don't get this. The log says it is executing this query: > > SELECT DISTINCT > t0_bean.a_Boolean, t0_bean.an_Int, t0_bean.a_Long, > t0_bean.a_Double, t0_bean.a_String > FROM CMP2ENTITY t0_bean > WHERE t0_bean.a_Boolean = true > > So what is wrong with that where clause? Are there any Oracle DBAs out > there that can shed some light on to why this query is rejected. > > -dain > > Stephen Coy wrote: > >> Reposted here at Dain's request... >> Begin forwarded message: >> Hi All, >> I think I have found a bug when specifying your own finder method >> with EJB QL and Oracle. >> The problem is that in EJB QL any comparisons to a boolean field must >> be made using the keywords TRUE or FALSE. When I do this I get an >> exception come back fromOracle telling me it doesn't know the field >> name. It seems that JBoss is not converting the TRUE or FALSE to a 1 >> or 0 when it sends the SQL to Oracle, that is, "...wheremyBoolean = >> true" is being sent to Oracle. >> I have tried all possible sensible to tags in >> the XML files. >> Anyway,I have created a unit test package for this - it is attached. >> It plugs into the JBoss testsuite. To compile the test, you will need >> to add the following to the jboss-all/testsuite/build.xml: >>> depends="compile, >>... >>_jars-dbtest, >>_jars-findWhereBoolean, >>... >>_jars-bankiiop"> >> >> >> >> >> >> > manifest="${build.etc}/manifest.mf"> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> If you're interested, the actual JBoss server.log error message and >> stack trace is: >> 2002-05-13 18:18:45,506 DEBUG >> [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.CMP2Entity.findAllWhereBooleanIsTrue] >> Executing SQL: SELECT DISTINCT t0_bean.a_Boolean, t0_bean.an_Int, >> t0_bean.a_Long, t0_bean.a_Double, t0_bean.a_String FROM CMP2ENTITY >> t0_bean WHERE t0_bean.a_Boolean = true >> 2002-05-13 18:18:45,516 DEBUG >> [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.CMP2Entity.findAllWhereBooleanIsTrue] >> Find failed >> java.sql.SQLException: ORA-00904: invalid column name >> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180) >> at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208) >> at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543) >> at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1451) >> at >> oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:651) >> at >> oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2117) >> at >> oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout >> (OracleStatement.java:2331) at >> oracle.jdbc.driver.OraclePreparedStatement.executeUpdate >> (OraclePreparedStatement.java:422) at >> oracle.jdbc.driver.OraclePreparedStatement.executeQuery >> (OraclePreparedStatement.java:366) at >> org.jboss.resource.adapter.jdbc.local.PreparedStatementInPool.executeQuery( >> PreparedStatementInPool.java:862) 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:466) at >> org.jboss.ejb.plugins.CMPPersistenceManager.findEntities >> (CMPPersistenceManager.java:348) at >> org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities( >> CachedConnectionInterceptor.java:284) at >> org.jboss.ejb.EntityContainer.find(EntityContainer.java:662) >> at java.lang.reflect.Method.invoke(Native Method) >> at >> org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome >> (EntityContainer.java:) at >> org.jboss.ejb.plugins.AbstractInterceptor.invokeHome >> (AbstractInterceptor.java:73) at >> org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome >> (EntitySynchronizationInterceptor.java:230) at >> org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome( >> CachedConnectionInterceptor.java:176) at >> org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome >> (EntityInstanceInterceptor.java:134) at >> org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome >> (EntityLockInterceptor.java:79) at >> org.jboss.ejb.plugins.EntityCreati
Re: [JBoss-user] Fwd: Bug when converting EJB QL boolean comparisons from true and false to 1 and 0
I don't get this. The log says it is executing this query: SELECT DISTINCT t0_bean.a_Boolean, t0_bean.an_Int, t0_bean.a_Long, t0_bean.a_Double, t0_bean.a_String FROM CMP2ENTITY t0_bean WHERE t0_bean.a_Boolean = true So what is wrong with that where clause? Are there any Oracle DBAs out there that can shed some light on to why this query is rejected. -dain Stephen Coy wrote: > Reposted here at Dain's request... > > Begin forwarded message: > > > > Hi All, > > I think I have found a bug when specifying your own finder method with > EJB QL and Oracle. > > The problem is that in EJB QL any comparisons to a boolean field must be > made using the keywords TRUE or FALSE. When I do this I get an > exception come back fromOracle telling me it doesn't know the field > name. It seems that JBoss is not converting the TRUE or FALSE to a 1 or > 0 when it sends the SQL to Oracle, that is, "...wheremyBoolean = true" > is being sent to Oracle. > > I have tried all possible sensible to tags in the > XML files. > > Anyway,I have created a unit test package for this - it is attached. It > plugs into the JBoss testsuite. To compile the test, you will need to > add the following to the jboss-all/testsuite/build.xml: > > > > > > > > > > > manifest="${build.etc}/manifest.mf"> > > > > > > > > > > > > > > > > > > > > > > > > > > If you're interested, the actual JBoss server.log error message and > stack trace is: > > > 2002-05-13 18:18:45,506 DEBUG > [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.CMP2Entity.findAllWhereBooleanIsTrue] > Executing SQL: SELECT DISTINCT t0_bean.a_Boolean, t0_bean.an_Int, > t0_bean.a_Long, t0_bean.a_Double, t0_bean.a_String FROM CMP2ENTITY > t0_bean WHERE t0_bean.a_Boolean = true > 2002-05-13 18:18:45,516 DEBUG > [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.CMP2Entity.findAllWhereBooleanIsTrue] > Find failed > java.sql.SQLException: ORA-00904: invalid column name > > at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180) > at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208) > at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543) > at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1451) > at > oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:651) > at > oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2117) > > at > oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2331) > > at > >oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:422) > > > at > >oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:366) > > > at > >org.jboss.resource.adapter.jdbc.local.PreparedStatementInPool.executeQuery(PreparedStatementInPool.java:862) > > > 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:466) > > > at > >org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:348) > > > at > >org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:284) > > > at org.jboss.ejb.EntityContainer.find(EntityContainer.java:662) > at java.lang.reflect.Method.invoke(Native Method) > at > >org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:) > > > at > org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73) > > at > >org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:230) > > > at > >org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:176) > > > at > >org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134) > > > 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:167) > > 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:109) > at org.jboss.ejb.EntityContainer.invokeHome(Ent