title: Oracle AQ dequeue order
body: <p>A trigger in an Oracle 10g generates upsert and delete messages for a subset of rows in a regular table. These messages consist out of two fields:</p>
  
  <ul>
  <li>A unique row id.</li>
  <li>A non-unique id.</li>
  </ul>
  
  <p>When consuming these message I want to impose an order on the deque process that respects the following constraints:</p>
  
  <ul>
  <li>Messages must be dequeued in insertion order.</li>
  <li>Messages belonging to the same id must be dequeued in such a fashion that no other dequeuing process should be able to dequeue a potential successor message (or messages) with this id. Since the messages are generated using a trigger I cannot use groups for this purpose.</li>
  </ul>
  
  <p>I am using the Oracle Java interface for AQ. Any pointers on how that could be achieved?</p>