title: Error on Oracle while using DBLINK
body: <p>I am Using jboss5.1.x, EJB3.0 ,JPA3.</p>
  
  <p>I am trying to do 'select' query from view which is connected via <strong>dblink</strong> to another database.</p>
  
  <p>source database is <strong>Oracle 9</strong>, destination dabatase is <strong>Oracle 8</strong>.</p>
  
  <p>I am getting this error:</p>
  
  <pre><code>15:27:06,625 WARN [JDBCExceptionReporter] SQL Error: 24777, SQLState: 99999
  
  15:27:06,625 ERROR [JDBCExceptionReporter] ORA-24777: use of non-migratable database link not allowed
  </code></pre>
  
  <p>I found solution to this error after I understood that I cant use <strong>dblink</strong> while using <strong>XA</strong>. So I managed to solved by changing the dblink script to <strong>create shared database link</strong> as follow: </p>
  
  <pre><code> CREATE SHARED DATABASE LINK CONNECT TO IDENTIFIED BY AUTHENTICATED BY IDENTIFIED BY USING 
  </code></pre>
  
  <p>everything worked fine in this test environment. </p>
  
  <p>Now I've moved my application to production environment, where the source database is <strong>Oracle 11</strong> while the destination is still <strong>Oracle 8</strong>.</p>
  
  <p>The trick that I used didnt work this time and I couldnt find a solution. This is the new exception I am getting:</p>
  
  <pre><code>    Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
      at ....Caused by: java.sql.SQLException: ORA-01012: not logged on
      ORA-02063: preceding line from TO_VANTIVE
  </code></pre>
  
  <p>Thanks for your help,</p>
  
  <p>ray,</p>