From the Oracle documentation on the enqueue method of DBMS_AQ, it is specified that "Names for objects are specified by an optional schema name and a name. If the schema name is not specified, the current schema is assumed." [1]
The system in question defines all objects in a schema, let's call it DEV. Users are then defined like DEV_AD, and during login, there is a trigger which ALTER SESSIONs their current schema to DEV. This means that when they select * from sometable, they select * from DEV.sometable, and not DEV_AD.sometable. There are no issues with this.
However, when the user tries to enqueue a message on SOMEQUEUE, it doesn't work - the system tries to enqueue on DEV_AD.SOMEQUEUE which doesn't exist, rather than DEV.SOMEQUEUE. By placing DEV.SOMEQUEUE rather than just SOMEQUEUE as the argument to DBMS_AQ.ENQUEUE, the message is successfully queued.
Is this an Oracle bug (or documentation error), and is there a workaround?
If it's a bug, we're still using 10.2.0.4.0 for the next few months. Is it fixed in 11g?
[1] http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_aq.htm#ARPLS081