Tony,

This has more to do with how Oracle handles transactions. Table creation and deletion are not transactional, but all of your updates and inserts are.

-Erik

Tony Tay wrote:

hi Erik,


Message: 5
Date: Wed, 31 Mar 2004 22:55:30 -0800
From: Erik Bruchez <[EMAIL PROTECTED]>
Subject: Re: commit and rollback
To: OXF Users <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii; format=flowed

Tony,

OXF will by default do what you expect, which is to do a commit at the
end of processing a page. This means that by default your three
updates will be part of the same transaction and your updates will be
rolled back if an error occurs before the page request completes.



If that is the case, then for the following snippet (shown below), the data
table "friends" should be left in its original state, ie., no data changes.
What i found was that it deleted all data and created a blank "friends"
table.  I added the line "insert into xxxbb ..." to force a SQL error.

<sql:connection>
     <sql:datasource>db</sql:datasource>
     <sql:execute>
                        <sql:update>drop table friends</sql:update>
      </sql:execute>
      <sql:execute>
                        <sql:update>create table friends (id varchar2(10),
first varchar2(25), last varchar2(25), phone varchar2
(15))</sql:update>
       </sql:execute>

                    <sql:execute>
                        <sql:update>insert into friends values ('1', 'Tony',
'Tay', '555-1234')</sql:update>
                    </sql:execute>

                    <sql:execute>
                        <sql:update>insert into friends values ('2',
'Terry', 'Moore', '555-5678')</sql:update>
                    </sql:execute>

                    <sql:execute>
                        <sql:update>insert into friends values ('3', 'Joe',
'Black', '555-9876')</sql:update>
                    </sql:execute>

                    <sql:execute>
                        <sql:update>insert into friends values ('4',
'Chris', 'Ross', '555-2376')</sql:update>
                    </sql:execute>

                     <sql:execute>
                        <sql:update>insert into xxxbbb values ('40',
'Chris', 'Ross', '555-2376')</sql:update>
                    </sql:execute>

                    <!--<dummy/> -->
                </sql:connection>


ERROR message:


Thread-6 INFO  sql.SQLProcessor - Rolling back JDBC connection for
datasource: jdbc/db.
Thread-6 ERROR servlet.ProcessorService - Exception at
oxf:/sql/populate.xpl, line 45, column 37
java.sql.SQLException: ORA-00942: table or view does not exist

 at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:158)
 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
 at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
 at
oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:18
1)


_______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users

_______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users

Reply via email to