Bug 120189 - c.a.kernel.Group#getContainedParties is broken since persistence test-qgen land
c.a.kernel.Group#getContainedParties is broken since persistence test-qgen land
Product: Red Hat Web Application Framework
Classification: Retired
Component: persistence (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: ccm-bugs-list
Jon Orris
Depends On:
  Show dependency treegraph
Reported: 2004-04-06 13:00 EDT by Daniel Berrange
Modified: 2007-04-18 13:05 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-04-07 05:06:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Daniel Berrange 2004-04-06 13:00:50 EDT
Description of problem:
When calling the 'getContainedParties' method on a c.a.kernel.Group
object, an SQL syntax exception is thrown by Oracle. This has only
started happening since test-qgen.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a group
2. Add some members
3. Call getContainedParties()
Actual results:
    [junit] 2004-04-06 18:03:38,043 [ main] ERROR rdbms.RDBMSEngine -
select t0.party_id as "this.id",
    [junit]        t12.object_type as "this.objectType",
    [junit]        t12.display_name as "this.displayName",
    [junit]        t12.default_domain_class as "this.defaultDomainClass",
    [junit]        t0.primary_email as "this.primaryEmail",
    [junit]        t0.uri as "this.uri"
    [junit] from parties t0
    [junit] join acs_objects t12 on t0.party_id = t12.object_id
    [junit] where t0.party_id in (select party_id from (
    [junit]         select member_id as party_id
    [junit]         from group_member_map
    [junit]         where group_id = ?
    [junit]         UNION ALL
    [junit]         select subgroup_id as party_id
    [junit]         from group_subgroup_map
    [junit]         where group_id = ?) insub)
    [junit] java.sql.SQLException: ORA-00923: FROM keyword not found
where expected

    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at com.redhat.persistence.Cursor.execute(Cursor.java:130)
    [junit]     at com.redhat.persistence.Cursor.next(Cursor.java:114)
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at java.lang.reflect.Method.invoke(Native Method)
    [junit]     at junit.framework.TestCase.runTest(TestCase.java:154)
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at junit.framework.TestResult.run(TestResult.java:109)
    [junit]     at junit.framework.TestCase.run(TestCase.java:118)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:203)
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:203)
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at
    [junit]     at

Expected results:
No exception

Additional info:

This is a very critical show stopper bug preventing user/group
administration working in APLAWS portal application.
Comment 1 Daniel Berrange 2004-04-06 13:01:43 EDT
I added a test case to GroupMemberTest in the KernelSuite at p4 42006.
Comment 2 Rafael H. Schloming 2004-04-06 13:14:11 EDT
Is there an oracle version number for this? The SQL seems to run fine
in my sqlplus.
Comment 3 Daniel Berrange 2004-04-06 13:23:39 EDT
Yes, more investigation shows that it only affects certain oracle DBs.

I have it failing on:

Oracle9i Enterprise Edition Release - Production
Oracle9i Release - Production 

But working on:

Oracle9i Enterprise Edition Release - Production
Oracle9i Enterprise Edition Release - Production

Yes, it really does work & fail on different instances of,
which is rather odd...

Comment 4 Rafael H. Schloming 2004-04-06 13:34:51 EDT
That's what I was afraid of. Does someone with a metalink account want
to search or loan me the account info so I can search?
Comment 5 Rafael H. Schloming 2004-04-06 13:51:14 EDT
What versions of JDBC are you using on each of those installs? It's
possible that the bug is in the JDBC driver and not oracle itself. You
could also try executing the same query in sqlplus on each instance to
see if we can reproduce it with no JDBC in the equation.
Comment 6 Daniel Berrange 2004-04-06 13:56:40 EDT
I've searched on Metalink & it appears to be a bug fixed in
The work around for earlier versions of oracle is:

 alter session set "_PUSH_JOIN_UNION_VIEW" = false;

We had this workaround present in 5.2 in the OracleConnectionPoolImpl
class, but its missing from Rickshaw.
Comment 7 Daniel Berrange 2004-04-06 14:20:28 EDT
The neccessary code appears to be present in c.a.util.jdbc.Connections:

            // XXX Use connection metadata to find out if this is the
            // bad oracle.  Do we need to do this this often?
            //if (false) {
            //    final PreparedStatement stmt = conn.prepareStatement
            //        ("alter session set \"_push_join_union_view\" =
            //    stmt.execute();

We ought to be able to uncomment this & change 'if(false)' to 

DatabaseMetadata meta = conn.getMetaData();
if ("Oracle".equals(meta.getDatabaseProductName()) &&
    (meta.getDatabaseProductVersion().indexOf("9.0.1") != -1 ||
     meta.getDatabaseProductVersion().indexOf("") != -1)) {
Comment 8 Rafael H. Schloming 2004-04-06 15:07:14 EDT
Ah, interesting. I believe when we originally encountered the bug it
resulted in an 0600 rather than the syntax error. I'll submit a fix.
Comment 9 Rafael H. Schloming 2004-04-06 15:22:39 EDT
This should be fixed as of @42010.
Comment 10 Rafael H. Schloming 2004-04-06 15:39:31 EDT
It occurs to me that the fact that the newly added test passes for me
doesn't mean much since my version of oracle doesn't have the bug, so
we should probably verify this fix on the same db that is known to
exhibit the problem.
Comment 11 Daniel Berrange 2004-04-07 05:06:10 EDT
I've verified this fixes the problem on our unpatched Oracle DB, so
marking it RAWHIDE.

Note You need to log in before you can comment on or make changes to this bug.