Hello! fp :)

Oracle 10g + Castor 9.5.3 + jboss 3.2.3

A simple O/R mapping works in fine if jdbc parameters are defined in
database.xml file. I reference that as stand-alone mode. 

<!--stand-alone database.xml -->
<database name="beer_db" engine="oracle" >
    <driver url="jdbc:oracle:thin:@beer:1521:orcl"
class-name="oracle.jdbc.OracleDriver">
        <param name="user" value="user" />
        <param name="password" value="password" />
    </driver>
  <mapping href="mapping.xml" />
</database>

When deployed to jboss, the qry.execute() fails with error message:
You cannot set autocommit during a managed transaction!

Is there a way to disable castor from making the autoCommit() call? 

Thanks,
Donnie

<!-- j2ee datasource -->
<database name="at4" engine="oracle">
   <jndi name="java:/AT4ServerDS" />
   <mapping href="castor_mapping.xml" />
</database>

code snippet:
         try {
            // initialize castor transaction
            db.begin();
            
            // initialize query
            qry = db.getOQLQuery("SELECT p FROM myObj.DataSetLayout p
where p.dataSetName = $1");
            
            // bind parameters
            qry.bind(datasetName);
            
            // execute query
            results = qry.execute();

            // only one is needed
            DataSetLayout layout = null;
            
            // process results
            while (results.hasMore()) {
               // grab new layout
               layout = (DataSetLayout) results.next();
               
               // add object to array
               retArr.add(layout);
            }
            
         } catch (Exception ex) {
            String message = ExMsgFormatter.format("Castor lookup
failed", ex);

            _logger.error(message);
            throw new Exception(message);
            
         } finally {
            
            try {
               db.commit();
            } catch (Exception ignored) {
               // ignored
            }
            
         }



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to