2 Replies Latest reply on Jul 31, 2006 7:51 AM by koji lin

    using the same datasource for entity bean and pure jdbc

    koji lin Newbie

      i wanna using the entity bean and direct jdbc sql update in the same transaction

      i defined xxx-ds.xml

      <local-tx-datasource>
       <jndi-name>SIMPLE_DS</jndi-name>
       ....
      </local-tx-datasource>
      


      and jboss-cmp.xml
      <defaults>
       <datasource>java:/SIMPLE_DS</datasource>
       <datasource-mapping>Oracle9i</datasource-mapping>
       </defaults>
      


      and using
      initialContext.lookup("java:/SIMPLE_DS")
      


      if i use both(entity update, sql query or entity query, sql update) in the same method, do they really use the same transaction?

      and i found that if i update the record by using entity bean, then try to query the result in the same service method, the jdbc query will get the old data.

      i wanna know is there any document discuss about this?
      is it a bad decision to mix pure jdbc and entitybean?(bcz entity bean is really hard for complex query for me)..

      best regards