Prevent Rollback

I have a bpel that processes an array in a loop. I have it set up to catch faults within the loop, and send them to an error queue.
At the end of the loop, I throw a fault if there were any faults caught during the loop. A global catch all cathes this fault, or any other unhandled faults, sending the latter to the error queue.
I want to have the instance end in a faulted state, by rethrowing from the global catch all, but this rolls back all the messages that I send to the error queue, as well as any successful processing accomplished in the loop (messages sent to other queues).
So I thought that putting a dehydrate action before the rethrow would commit everything in the instance, and then the rethrow would cause the instance to be faulted. But now the faulted instances get stuck in the Running state, on the dehydrate step.
Is dehydrating taking this long (been over an hour so far)? Or is there something else going on here? Is there a better way to accomplish what I am trying to do here?
Thanks.

Try doing the processing in a separate scope and then add dehydrate at the end of the scope. throw the fault from outside of this scope. If this doesn't work you may have to do the processing in another child bpel process and mark the bpel transaction property for the child process as requiresnew.
<property name="bpel.config.transaction"
many="false" type="xs:string">requiresNew</property>
For BPEL caller and callee transaction semantics refer
http://docs.oracle.com/cd/E21764_01/integration.1111/e10224/soa_transactions.htm

Similar Messages

  • Why Oracle does not allow rollback of  DDL statements?

    I have always been surprised why Oracle does a implicit commit when DDL statements (e.g create table …) are executed. DDL statements simply write information (insert, delete and update) to data dictionary, so why DDL statement cannot be rolled back. Am I missing some thing?
    I was learning SQL Server few months ago and I noticed that SQL Server does allow rollback of DDL statements if I am not mistaken. It lloks like there is something in Oracle architecture which prevents rollback of DDL satements. Rollback of all staements should be allowed not just of DML statements.
    Appercaite your insight.

    If you drop a 500 million row table (and let's assume you're not using the Recycle Bin, which is a different matter entirely), how do you propose to re-insert all 500 million rows if you were to be allowed to rollback the drop command? Same thing goes for a truncate command.
    I'm not saying there aren't workarounds (the Recycle Bin is precisely one of those), but it's certainly problematic. You could very well reverse the transaction ('delete from TAB$...') quite easily... but reversing the other consequences of that transaction is a lot more awkward. Therefore, it is certainly logical to declare such transactions irreversible and thus to imply a commit, both before and after.
    Or take it from another philosophical angle: a transaction that doesn't commit (or rollback) takes exclusive row-level locks that are held indefinitely and which will prevent other people from doing DML on the same rows, yes? Well, how do you fancy having an 'alter table' statement sitting around, uncommitted, in the data dictionary? Some process (or your users) are wanting to insert rows into this table, but the uncommitted alter command means that they can't acquire the shared table lock they need in order to be able to do so. One uncommitted DDL can seriously gum up the works, in short.
    Dictionary tables are not like ordinary user tables, because whilst what I do in INVOICES very likely has no impact on what you do in SALARIES, what I propose to do in TAB$ very definitely impacts what you might need to do in TAB$. Under those circumstances, it's a jolly good thing that Data Dictionary DDL doesn't leave a trail of uncommitted transactions hanging around! And the mechanism to achieve that 'good thing' (i.e., auto-committing) means such transactions must be immediately irreversible.
    Fair enough if other databases have chosen to handle things differently: their prerogative, of course. My point is simply that there is logic in NOT being able to roll back DDL statements, too, and it's a legitimate choice to have made to handle things in this way, too.

  • ADF vs RichFaces

    what do you think about ADF vs RichFaces to connect with EJB3.
    thanks

    * ADF-config.xml the designer when they are no longer shows many views flows
    I don't know what you did, but we have a huge project and that one never failed. Anyway, there's still the source mode and this is not linked to ADF Faces so it's by no mean something relevant in an ADF Faces - Richfaces comparison
    * You can not do without preventing rollback error messages business rules in the database are lost (I saw the need to put an Undo button).
    That is an ADFm, again not linked to ADF Faces and thus irrelevant in an ADF Faces - Richfaces comparison.
    * The IDE shows java error every 10 minutes.
    IDE issue, not linked to ADF Faces, again irrelevant in the comparison.
    * The IDE does not compile correctly caundo changes made on several occasions.
    See above.
    Just a sea of bugs that could spend the afternoon describing. I do not think "small minor bugs."
    Simon Lessard Rich Faces do not use because I would do if I am not forced to use ADF: D: D Rich patches faces at least its major bugs so that users can continue using it, but ADF patch when it comes out? could answer? until that time my enterprise application die:).
    Actually, if you have the right support level from Oracle (paid), you can get critical patches outside the JDeveloper release cycle and, as I thought, the grass is always greener on the other side of the fence, or so it looks. Until you have used a product to deliver the same grade of application, assuming that it's bug free is mostly a mix of fantasy, magical and wishful thinking.
    That being said, I'm not saying your IDE issues are unimportant, it's just that they are not linked at all to ADF Faces which is the ADF competitor of Richfaces. You could create an application using ADF Faces and Facelets in Eclipse, Netbean or IntelliJ without any problem, so that your "bugs" wouldn't haunt you. You are mixing apples and oranges... and venting out frustration from your work imho.
    Regards,
    ~ Simon

  • How to script schema upgrade as single success unit

    We currently use a combination of Ingres and SQL Server databases. When upgrading a schema of our own design we will script the upgrade as a single success unit. If any part fails then the whole lot is rolled back. (This is a slight simplification but it's the general principle we follow). However in Oracle I believe DDL statements are automatically committed. This is thwarting our attempts to adopt the same approach with Oracle.
    As a simple example say a column is being moved from one table to another (for whatever reason). The application changes to be implemented depend on three things happening:
    1. table_new has column_new added to it
    2. column_new on table_new is populated from column_old on table_old
    3. table_old has column_old dropped from it
    so the upgrade script will run something like:
    Start Transaction
    alter table table_new add column_new(etc... ;
    update table_new set column_new = (select column_old from table_old etc.... ;
    alter table_old drop column_old ;
    If Error then
    Rollback
    Else
    Commit Transaction
    This way if there is an error then the database is left in a state that works with the old application code. If the upgrade succeeds then the new application code can implemented.
    So my questions are:
    1. Am I correct in thinking that in Oracle, step 1 above will commit as soon as it's submitted preventing rollback?
    2. If so then what would people recommend as a way to achieve a single success unit for a schema upgrade?
    We were hoping to use flashback with restore points to perform the equivalent of a rollback if there were any errors in the upgrade script. Having tried that this afternoon though, I received an error about being unable to flashback the table because it had been changed (don't have the error here I'm afraid as I'm at home now). Would restoring the tablespace (we are setting up one tablespace per schema) to a point in time before the upgrade script started be reasonable? It seems a little extreme and also considerably more difficult to script than the flashback option. Otherwise I'm thinking that some combination of creating a new table, populating it, dropping the old table, renaming the new table with the original name might be an option. However this obviously has much greater overheads, higher chance of error and considerably more messing about if constraints, rules and procedures are involved.
    Any suggestions or corrections on what I've added above are appreciated.
    thanks
    Mark

    Thanks for the responses.
    Unfortunately this will always be a case of altering the schema rather than creating it once applications are running against Oracle.
    Tablespace point in time recovery is probably looking like the best option so far. A script would only ever upgrade one schema at a time and we're setting things up to use one tablespace per schema.
    Proving and then rehearsing a TSPITR (as I believe it's called) is on the list of things that we need to do but it seems like it may be needed as a more routine tool than just in emergencies. I shall concentrate my reading in that direction. Would anybody care to offer any opinions on automating restores for this situation? We have people on call but generally only plan to come in out of hours to check the outcome of big upgrades. Smaller schema upgrades are left to pass or rollback overnight.
    It's a real shame that flashback works at the database and table levels but does not have a tablespace option as that would be perfect. Flashing back the whole database could be problematic as we will probably end up with multiple schemas in each database, each one being used by different applications so we could realistically have applications running against some schema_a whilst we're upgrading schema_b. Flashing back the whole database would obviously then cause problems in schema_a, or schema_a or the associated application would have to be suspended while we upgraded schema_b. Whilst we're lucky enough to have some downtime with most of our applications, this is gradually disappearing and there are some which are now approaching 24/7 availability.
    I'm still open to other suggestions though. This seems so much more complicated than the approach which has worked for Ingres and SS. Do you apply schema changes whilst the system is running? Does somebody do this manually or is it scheduled?
    thanks again
    Mark

  • Is there a real fix (not rollback) to prevent plugin-container from hoarding my memory/cpu usage?

    When I use/view flashplayer my video is simply unwatchable. This wasn't so with ie8. is there a real fix for this plug-in container using more memory than firefox is actually using? I have the newest version of firefox. I just started using firefox so I could avoid as much of Microsuck as possible. Currently I cannot use flashplayer. Please help and thank you in advance.

    That's supposed to indicate it's your plug-ins like Flash that is the problem.
    You might try changing hardware acceleration, a setting within Flash either turn if off or on.

  • Rollback segment Error coming for 8 lacks Record while creating MV

    Hi All,
    i am creating a materialized View and it gives us 8 lacks record but when we creates in production its fails due to rollback segment does not have enough space to handle it and it did not create the MV.
    can anyone help me out to resolve this issue for the below query while creating MV.
    SELECT DISTINCT NVL
    ((ROUND ((jt_date_completed - jt_date_requested) * 24, 2)
    0
    ) AS actual_hrs_to_complete,
    NVL ((ROUND ((jt_date_responded - jt_date_requested) * 24, 2)
    0
    ) AS actual_hrs_to_respond,
    peo1.peo_name AS agent_name,
    peo1.peo_user_name AS asagent_soe_id,
    le.lglent_desc AS ap_system,
    ' ' AS assign_work_request_comment,
    DECODE (jt.jt_bill_id,
    138802, 'CLIENT BILLABLE',
    138803, 'CONTRACTED',
    138804, 'INTERNAL BILLABLE',
    NULL, ' '
    ) AS billable,
    bl.bldg_name_cc AS building, bl.bldg_id_ls AS building_id,
    DECODE (bl.bldg_active_cc,
    'Y', 'ACTIVE',
    'INACTIVE'
    ) AS building_status,
    DECODE (jt.jt_wrk_cause_id,
    141521, 'STANDARD WEAR AND TEAR',
    141522, 'NEGLIGENCE',
    141523, 'ACCIDENTAL',
    141524, 'MECHANICAL MALFUNCTION',
    141525, 'OVERSIGHT',
    141526, 'VANDAL',
    141527, 'STANDARD',
    141528, 'PROJECT WORK',
    6058229, 'TEST',
    NULL, ' '
    ) AS cause_type,
    ' ' AS comments, peo3.peo_name AS completed_by,
    jt.jt_requestor_email AS contact_email,
    jt.jt_requestor_name_first
    || ' '
    || jt.jt_requestor_name_last AS contact_name,
    jt.jt_requestor_phone AS contact_phone,
    cc.cstctrcd_apcode AS corp_code,
    cc.cstctrcd_code AS cost_center,
    jt.jt_date_closed AS date_closed,
    jt.jt_date_completed AS date_completed,
    jt.jt_date_requested AS date_requested,
    jt.jt_date_responded AS date_responded,
    jt.jt_date_response_ecd AS date_response_ecd,
    jt.jt_date_scheduled AS date_scheduled,
    DECODE (jt.jt_def_id,
    139949, 'WTG VENDOR RESPONSE',
    139950, 'WAITING ON PARTS',
    139951, 'LABOR AVAILABILITY',
    139952, 'DEFERRED- HI PRI WORK',
    139953, 'WTG APPROVAL',
    139954, 'FUNDING REQUIRED',
    139955, 'ACCESS DENIED',
    139956, 'WTG MATERIAL',
    NULL, ' '
    ) AS deferral_reason,
    jt.jt_description AS description,
    jt.jt_date_resched_ecd AS ecd,
    fmg.facility_manager AS facility_manager,
    fl.floors_text AS FLOOR, gl.genled_desc AS general_ledger,
    ' ' AS kiosk_date_requested, ' ' AS kiosk_dispatch_confirmed,
    ' ' AS kiosk_dispatched,
    eqp.equip_customer_code AS linked_equipment_alias,
    eqp.equip_id AS linked_equipment_id,
    eqp.equip_text AS linked_equipment_name,
    DECODE (jt_originator_type_id,
    1000, 'PROJECT MOVE REQUEST',
    138834, 'CUSTOMER INITIATED CORRECTION',
    138835, 'CUSTOMER INITIATED REQUEST',
    138836, 'CORRECTIVE MAINTENANCE',
    138837, 'CONFERENCE ROOM BOOKING',
    138838, 'PROJECT INITIATED REQUEST',
    138839, 'PLANNED PREVENTIVE MAINTENANCE',
    138840, 'SELF INITATED REQUEST',
    NULL, ' '
    ) AS originator_type,
    ' ' AS payment_terms, priority_text AS priority_code,
    swoty.sworktype_text AS problem_type,
    prop.property_name_cc AS property,
    jt.jt_cost_quote_total AS quote_total,
    par.levels_name AS region,
    DECODE (jt.jt_repdef_id,
    141534, 'ADJUSTED SETTING',
    141535, 'TRAINING FOR END',
    141536, 'NEW REQUEST',
    141537, 'NO REPAIR REQUIR',
    141538, 'REPLACED PARTS',
    141539, 'REPLACE EQUIPMEN',
    1000699, 'NEW REQUEST',
    NULL, ' '
    ) AS repair_definitions,
    jt.jt_repairdesc AS repair_description,
    jt.jt_requestor AS requestor, ' ' AS requestor_cost_center,
    jt.jt_requestor_email AS requestor_email,
    jt.jt_requestor_name_first AS requestor_name,
    jt.jt_requestor_phone AS requestor_phone,
    ' ' AS response_time, rm.room_name_cc AS room,
    p1.peo_provider_code1 AS service_provider,
    p1.peo_address_1 AS service_provider_address,
    peocity.city_text service_provider_city,
    p1.peo_provider_code1 AS service_provider_code,
    peocity.city_country_name AS service_provider_country,
    peocur.currency_text AS service_provider_currency,
    p1.peo_name AS service_provider_description,
    p1.peo_dispatch_method AS serv_prov_dispatc_hmethod,
    p1.peo_rate_double AS serv_prov_double_time_rate,
    p1.peo_email AS service_provider_email,
    p1.peo_emergency_phone AS serv_prov_emergency_phone,
    p1.peo_fax AS service_provider_fax_number,
    p1.peo_home_phone AS service_provider_home_phone,
    p1.peo_rate_hourly AS service_provider_hourly_rate,
    p1.peo_title AS service_provider_job_title,
    p1.peo_method_id AS service_provider_method,
    p1.peo_cell_phone AS service_provider_mobile_phone,
    p1.peo_pager AS service_provider_pager,
    p1.peo_rate_differential AS service_provider_rates,
    p1.peo_rate_differential AS ser_prov_shift_differential,
    peocity.city_state_prov_text AS serv_prov_state_province,
    DECODE (p1.peo_active,
    'Y', 'ACTIVE',
    'INACTIVE'
    ) AS service_provider_status,
    p1.peo_url AS serv_prov_web_site_address,
    p1.peo_phone AS service_provider_work_phone,
    p1.peo_postal_code AS serv_prov_zip_postal_code, ' ' AS shift,
    ' ' AS skill,
    DECODE (jt.jt_bigstatus_id,
    138813, 'NEW',
    138814, 'PENDING',
    138815, 'OPEN',
    138816, 'COMPLETED',
    138817, 'CLOSED',
    138818, 'CANCELLED',
    NULL, ' '
    ) AS status,
    lev.levels_name AS subregion, ' ' AS trade,
    p1.peo_ls_interface_code1 AS vendor_id,
    p1.peo_fax AS vendor_purchasing_fax,
    p1.peo_vendor_site_code AS vendor_sitecode,
    jt.jt_id AS vendor_ticket, p1.peo_name AS vendor_companyname,
    jt.jt_requestor_vip AS vip, wo.wo_id AS work_order_no,
    jt.jt_id AS work_request,
    jt.jt_class_id AS work_request_class,
    woty.worktype_text AS work_type, ' ' AS wr_cost,
    jt.jt_description AS wr_description,
    ' ' AS wr_dispatch_method,
    DECODE (jt.jt_bigstatus_id,
    138813, 'NEW',
    138814, 'PENDING',
    138815, 'OPEN',
    138816, 'COMPLETED',
    138817, 'CLOSED',
    138818, 'CANCELLED',
    NULL, ' '
    ) AS wr_status,
    ctry.country_name AS country
    FROM citi.jobticket jt,
    citi.property prop,
    citi.bldg bl,
    citi.bldg_levels bldglvl,
    citi.LEVELS lev,
    citi.LEVELS par,
    (SELECT crstools.stragg (peo_name) facility_manager,
    bldgcon_bldg_id
    FROM citi.bldg_contacts, citi.people
    WHERE bldgcon_peo_id = peo_id
    AND bldgcon_contype_id IN (40181, 10142)
    GROUP BY bldgcon_bldg_id) fmg,
    citi.floors fl,
    citi.room rm,
    citi.general_ledger gl,
    citi.legal_entity le,
    citi.cost_center_codes cc,
    citi.equipment eqp,
    citi.worktype woty,
    citi.subworktype swoty,
    citi.work_order wo,
    citi.jt_workers jtwo,
    citi.priority,
    citi.country ctry,
    citi.people p1,
    citi.people peo3,
    citi.people peo1,
    citi.city peocity,
    citi.currency peocur
    WHERE jt.jt_bldg_id = bl.bldg_id
    AND bl.bldg_id = bldglvl.bldg_levels_bldg_id
    AND bldglvl.bldg_levels_levels_id = lev.levels_id
    AND lev.levels_parent = par.levels_id(+)
    AND prop.property_id = bl.bldg_property_id
    AND bl.bldg_active_ls <> 'N'
    AND jt.jt_floors_id = fl.floors_id(+)
    AND jt.jt_room_id = rm.room_id(+)
    AND jt.jt_bldg_id = fmg.bldgcon_bldg_id(+)
    AND jt.jt_genled_id = gl.genled_id(+)
    AND gl.genled_lglent_id = le.lglent_id(+)
    AND jt.jt_cstctrcd_id = cc.cstctrcd_id(+)
    AND jt.jt_equip_id = eqp.equip_id(+)
    AND jt.jt_id = jtwo.jtw_jt_id(+)
    AND jt.jt_worktype_id = woty.worktype_id(+)
    AND jt.jt_sworktype_id = swoty.sworktype_id(+)
    AND jt.jt_wo_id = wo.wo_id
    AND jt.jt_priority_id = priority_id(+)
    AND jt.jt_date_requested >= ADD_MONTHS (SYSDATE, -12)
    AND bl.bldg_country_id = ctry.country_id
    AND jtwo.jtw_peo_id = p1.peo_id(+)
    AND p1.peo_city_id = peocity.city_id(+)
    AND jt.jt_completed_by_peo_id = peo3.peo_id(+)
    AND p1.peo_rate_currency_id = peocur.currency_id(+)
    AND jt.jt_agent_peo_id = peo1.peo_id(+);
    Regards
    shyam~

    Hi,
    Its ora-1555? IS your undo_retention sufficient?
    Since you are developer the only option you have is to tune the query?
    Am curious to know like I create materialized view so that I do not have to run complex query on the master database / or to prevent the access to master database more than once to get the same data?
    Like to know which is your case because your query seem to be too complex to be the case for former. Do you think this materialized view would be used frequently in your application?
    Regards
    Anurag Tibrewal.

  • Web app Connection.close()...how to prevent

    Hello
    I am somewhat new to this, but I am developing an web application that will be a help desk of sorts for clients to log on and create trouble tickets, plus many other features. I have completed the project and it works fine when I first start tomcat but an unexpected state keeps occurring and I can't seem to figure it out.
    After a while (I say a while cause I'm not sure exactly how long, but I'd say +5 hours) my application no longer will work and in the tomcat log I get the following message.
    Could not execute a query statement!Connection.close() has already been called. Invalid operation in this state.
    java.sql.SQLException: Connection:close() has already been called.
    at com.mysql.jdbc.Connection.getMutex(Connection.java:1906)
    at com.mysql.jdbc.Statement.executeQuery(Statement.java:1115)
    at brokers.RelationalBroker.query(RelationalBroker.java:171)
    the RelationalBroker.java is
    package brokers;
    * Created on May 12, 2004
    * Class: RelationalBroker
    * Package: brokers
    * On-Track, Ticket Tracking System
    * @author
    * @version
    * This Class is used as the super class for all of the child brokers
    * for the database. The main purpose if this class is to allow all the
    * child classes to share the open connection to the database and execute
    * queries and updates on the database. This class is part of the brokers
    * package.
    //imports
    import java.sql.*;
    public class RelationalBroker {
        //Instance Attributes
         * The attribute con represented by a Connection object is used to hold
         * the active connection to the database. This connection is shared with
         * all of the child brokers.
        private Connection con = null;
         * The attribute statement represented by a Statement object is used to
         * execute the query and update statements on the database by the child
         * brokers.
        private Statement statement = null;
         * The attribute results represented by a ResultSet is used to hold
         * the results of a query executed on the database.
        private ResultSet results = null;
        //Constructors
         * Default constructor used to create a RelationalBroker object.
        public RelationalBroker(){
        //     Getters
         * The Getter getCon is used to get the Connection object.
         * @return Connection con.
        public Connection getCon() {
            return con;
         * The Getter getResults is used to get the ResultSet results.
         * @return ResultSet results.
        public ResultSet getResults() {
            return results;
         * The Getter getStatement is used to get the Statement object.
         * @return Statement statement.
        public Statement getStatement() {
            return statement;
        //Methods
         * The method connect is used to connect to the database given a username
         * password, location of driver, and URL of the database. This method also
         * creates the Statement object to be used for queries ans updates on the database.
         * @param driver A String containing the location of the database driver.
         * @param URL A String containing the location of the database on a netowrk.
         * @param user A String containing the username of the database account.
         * @param pass A String containing the password of the database account.
        public void connect(String driver, String URL, String user, String pass){
            try{
                Class.forName(driver);
                con = DriverManager.getConnection(URL, user, pass);
                statement = con.createStatement();
            catch (ClassNotFoundException cExp){
                System.out.println("Cannot find class for driver");
            catch (SQLException sqle){
                System.out.println("Error opening table or creating statement!: " + sqle.getMessage());
                sqle.printStackTrace();
                System.exit(0);
         * The method closeConnection is used to close the active connection
         * to the database.
         * @return A boolean containing the status of the connection, True if closed
         * false if open.
        public boolean closeConnection(){
            boolean isClosed = false;
            try{
                con.close();
                isClosed = con.isClosed();
            catch(SQLException sqle){
                System.out.println("Error closing connection!" + sqle.getMessage());
            //finally{
            return isClosed;
         * The method rollBack is used to execute a rollback statement on
         * the database, to undo any changes since the last commit.
         * @return void
        public void rollBack(){
            try{
                con.rollback();
            catch(SQLException sqle){
                System.out.println("Could not execute a  Rollback statement!" + sqle.getMessage());
                sqle.printStackTrace();
         * The method commit is used to execute a commit statement on the
         * database, to make any changes final.
         * @return void
        public void commit(){
            try{
                statement.executeUpdate("commit");
            catch (SQLException sqle){
                System.out.println("Could not execute a commit statement!" + sqle.getMessage());
                sqle.printStackTrace();
         * The method query is used to exceute a query statement on the
         * database to get back some results.
         * @param query A String containing the query to be executed on the database
         * @return a ResultSet containing the results.
        public ResultSet query(String query){
            results = null;
            try{
                //System.out.println("query: "+query);
                results = statement.executeQuery(query);
            catch(SQLException sqle){
                System.out.println("Could not execute a query statement!" + sqle.getMessage());
                sqle.printStackTrace();
            //finally{
            return results;
         * The method update is used to persist or remove information
         * from the database.
         * @param update String containing the update string to be exceuted;
        public void update(String update){
            try{
                statement.executeUpdate(update);
            catch(SQLException sqle){
                System.out.println("Could not execute an update statement!" + sqle.getMessage());
                sqle.printStackTrace();
    }//end classmy web.xml file to initialize with the database is as follows
    <servlet>
              <servlet-name>Connection</servlet-name>
              <servlet-class>servlets.ConnectionServlet</servlet-class>
              <init-param>
                   <param-name>url</param-name>
                   <param-value>jdbc:mysql://localhost/TICKETTRACK</param-value>
              </init-param>
              <init-param>
                   <param-name>driver</param-name>
                   <param-value>com.mysql.jdbc.Driver</param-value>
              </init-param>
              <init-param>
                   <param-name>user</param-name>
                   <param-value>---</param-value>
              </init-param>
              <init-param>
                   <param-name>password</param-name>
                   <param-value>---</param-value>
              </init-param>
              <load-on-startup>1</load-on-startup>
         </servlet>
    the ConnectionServlet.java is
    package servlets;
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import problemDomain.*;
    import brokers.*;
    * Title:
    * Description:      This servlet is used to create a connection with .
    * @author
    * @version 1.0
    public class ConnectionServlet  extends HttpServlet{
        private UserBroker uBroker;
        private TicketBroker tBroker;
        private CompanyBroker cBroker;
        public void init() throws ServletException{
            ServletConfig config = getServletConfig();
            String user = config.getInitParameter("user");
            String pass  = config.getInitParameter("password");
            String url  = config.getInitParameter("url");
            String driver = config.getInitParameter("driver");
            uBroker = UserBroker.getUserBroker();
            tBroker = TicketBroker.getTicketBroker();
            cBroker = CompanyBroker.getCompanyBroker();
            uBroker.connect(driver,url,user,pass);
            tBroker.connect(driver,url,user,pass);
            cBroker.connect(driver,url,user,pass);
    /*  This method is used to close the connection.
    *  @param none
    *  @return none.
        public void destroy() {
            try{
            }catch(Exception ec){
                System.err.println(ec);
    }I hope this is enough information for someone to help out. I'm out of ideas and my searches on the web didn't turn up much.
    I was thinking it was something to do with ConnectionPooling but I have never done that, or maybe its something to do with how I set up Connections or maybe its my Tomcat config or something to do with Mysql. I'm not even calling a Connection.close(), maybe that is my problem.
    Any help would be greatly appreciated, I'm not just looking for an answer I really would like to know why this occurs and how it can be prevented.
    Thanks,

    I really appreciate your reply and I can understand what you mean in theory(I think) but to actually implement it I'm having a little trouble.
    So for this database pool, in my ConnectionServlet which gets initialized on startup, should I create a Collection of connections for each instance(make them local), and than create another method to retrieve one of these connection when needed and when finished release it back to the collection(close)? Or is there some built in mechanism that can easily do this?
    I'm also reading up on that keep-alive you mentioned...it applies to the HTTP Connector element right? Is there a way to tell if this is an issue? I'm using Tomcat 5 and mySQL 3. I was talking with another guy here about using a connector to apache so it will work with the static pages and Tomcat do the servlet stuff, but I'm still trying to grasp all that.
    I don't know if this matters but many instances/windows of the web app can be opened at one time with seemingly no problems.
    Hope this made sense, like I said I'm pretty new to this so all I'm used to is simple configurations of web apps but hopefully I can advance further.
    Thanks again,

  • ADFBC+JSF - Current master record lost after Rollback

    Hi all,
    We've a master-detail page with a 'create new detail' command button that opens a new jspx page with a detail record creation form. From that creation page, if we hit the cancel button (bind to Rollback action) returning to the parent master-detail page, the current row for the master iterator has repositioned to the first row, thus losing the master-detail status where the user had previously.
    Doesn anyone know how to avoid this behavior without having to add code to reposition the iterators? (i.e how to maintain the iterators current rows after a Rollback?)
    Thanks in advance for any help,
    Jordi Lopez
    Message was edited by:
    Ramot

    This has been asked a number of times.
    The latest idea from Steve, to a previous thread of mine, was:
    Create an event for the onRollback, which does not invoke the default event action. This prevents the Rollback from occurring, but allows shouldAllowModelUpdates to return false.
    Since it's an Add a Detail, you could always issue a delete if it's only an add. If it's an [add] or [edit], then you'd need to do a row refresh, remove new rows, or look at an id# (pk) and if that is null or possibly negative depending on how you set it, remove the row via the iterator.
    [this is all based on 10.1.2/jsp/adf/struts]

  • How to prevent shared locks in SELECT statement?

    Hi,
    In SQL Server we can use (NOLOCK) to prevent shared locks on each row:
    Select * from table (NOLOCK)
    Do we have similar technique for oracle so it doesn’t consider a shared lock for each returned row?
    Thank you,
    Alan

    Yes - it's called a query ;-)
    Oracle was designed with a 'consistent read' mechanism that guarantees that a query will see the image of the data at the moment when the query started, regardless of the number of updates (including deletes) that have occurred since the query started. This is done using the rollback (aka undo) segment. Flip side - there is no such thing as a 'dirty read'.
    Because of the implementation, a simple select or subselect without coersion (such as the 'FOR UPDATE' clause) will not block writers, nor will writers (updates/inserts/deletes) block readers.
    In addition, an update in Oracle will only lock the rows affected by the update, there is no escalation of locks needed (or possible), and commits do not introduce any 'lock clearing' overhead.
    The penalties for all of this
    - the rollback segment must be sized appropriately or you end up with ORA-01555 errors;
    - you should not commit in loops, especially not loops controlled by a cursor;
    - code written to be efficient in SQL Server is often inefficient in Oracle, and vice versa.
    Recommended reading is Tom Kyte's book at http://www.apress.com

  • Rollback a transaction in a session bean BMP?

    The following code would work correctly if executed in a stateless session bean BMP?
    InitialContext ic = new InitialContext();
    javax.sql.DataSource dataSource = (javax.sql.DataSource) ic.lookup("java:comp/env/jdbc/OracleDS");
    Connection conn = dataSource.getConnection();     
    conn.setAutoCommit(false);
    Statement stmt = conn.createStatement("UPDATE TABLE_A SET NAME = 'Duke' WHERE ID = 7");
    stmt.executeUpdate();
    if (someCondition) {
    conn.commit();
    } else {
    conn.rollback();
    My question:
    It�s possible to rollback a transaction using rollback() from Connection class in a stateless
    session bean BMP?

    Dear JDC member:
    With EJB, you can gain the benefit of transactions without performing any transaction programming. That is, your enterprise beans never explicitly issue a begin, commit, or abort statement. The container performs it to you. But you have to tell the container how to do it. As you might know, the deploment descriptor is the place for it.
    But nothing prevent you to do do programmatic transaction as you want.. For that case you have to know JTA (Java Transaction API) and more.
    Suppose the transaction aborts, you have to throw an exception back to the client or try it again. The issue here is with stateless sesssion beans, there is no in-memory conversational state. You might think to implement javax.ejb.SessionSynchronization interface with your business methods....
    You see there is a lot to know. You can take care of transactions in the client code, but it is a bad design.
    You have to understand today most application servers (Websphere, Weblogic...) are designed to minimize those issues in order to make developers' tasks easier. The container takes care of transactions.
    Be careful when you write stateless session beans BMP (BMP are for entiti beans)
    Regards,
    Armand Komenan

  • FRM-40655: SQL error forced rollback: clear form and re-enter transaction.

    Hello ,
    I have ORACLE 10G & Forms 6i on Windows server 2008 . When I open the forms for some work , it give me error in few minis.
    FRM-40655: SQL error forced rollback: clear form and re-enter transaction.
    I have not done anything unusual in form design. it was working properly from a long time.
    Yesterday i set the default profile to idle_time = 20. Will that make any problem ???
    I checked my Alert Log but no sign of any deadlock in it, or any other unusual activity ....
    What is the solution ???
    Thanks in advance ..

    This happens due to dead lock situation
    To avoid this problem, add NOWAIT option to the UPDATE and DELETE statements, which returns ORA-00054 error, trap this error and display user defined message like 'The record is being accessed and try after some time'.
    This even improves the performance
    because no process waits for the locks preventing dead locks.
    If it is due to the UPDATE's or DELETE's with base table blocks in the form, in the PRE-UPDATE and PRE-DELETE triggers write SELECT statements to select the particular row with FOR UPDATE NO WAIT option. Handle by trapping the ORA-00054 error

  • GetWarnings on Connection throws exception if rollback = true

    I am trying to use hibernate within WLS 7SP4 and I get an exception everytime it
    tries to close an exception.
    inside
    weblogic.jdbc.jts.Connection.getWarnings()
    the first thing it does is call the method
    checkIfRoleBack(). This essentially throws an exception if the Transaction is
    currently in a roleback state
    If you look at the java API for get warnings it says it should only throw an exception
    if a database access error occurs. However a transaction being in a roleback state
    is not exactly a database error it is a perfectly valid state.
    THe problem I have is that when Hibernate tries to close a connection it also
    tries to log all the warnings on the connection. This means that closing a rolledback
    connection always throws an exception.
    Is this a bug in the weblogic implementation of Connection or is this expected
    beahviour.

    In that case we will be fine and the change is not that important
    Thanks
    Carl
    Joe Weinstein <[email protected]> wrote:
    >
    >
    Carl wrote:
    If the tx times out will I still be able to use sessionContext.getRollBackOnly()
    or will this only work if manually set.That should certainly still work. It is only JDBC that is prevented after
    the
    tx is done.
    Joe
    Thanks
    Carl
    Joe Weinstein <[email protected]> wrote:
    Carl Marais wrote:
    Thanks Joe for the response.
    My current solution is just to log and consume the exceptions if doinga close
    when the SessionContext of the EJB is set to Rollback. Judging fromwhat you are
    saying this should not have any impact on overall processing and theoriginal
    business exception can still flow through to the clientCorrect. The exception from getWarnings() has no effect on any processing
    and
    can be ignored if it's meaning is understood. We will currently allow
    no jdbc
    to be done, as soon as the tx is done for any reason. This could occur
    at any
    time, if for instance the tx reached it's timeout limit in-flight.
    Let me know how important the change I suggested is, or whether
    you're
    OK
    as-is for now with the above explained.
    thanks,
    Joe
    Joe Weinstein <[email protected]> wrote:
    Carl Marais wrote:
    I am trying to use hibernate within WLS 7SP4 and I get an exceptioneverytime it
    tries to close an exception.
    inside
    weblogic.jdbc.jts.Connection.getWarnings()
    the first thing it does is call the method
    checkIfRoleBack(). This essentially throws an exception if the Transactionis
    currently in a roleback state
    If you look at the java API for get warnings it says it should onlythrow an exception
    if a database access error occurs. However a transaction being in
    a
    roleback state
    is not exactly a database error it is a perfectly valid state.
    THe problem I have is that when Hibernate tries to close a connectionit also
    tries to log all the warnings on the connection. This means that
    closing
    a rolledback
    connection always throws an exception.
    Is this a bug in the weblogic implementation of Connection or is
    this
    expected
    beahviour.Hi. I can see it's being unexpected, but we must do all we can toensure
    that
    application code does no JDBC (which for the most part is intendedto
    contribute
    to the transaction) when the transaction is not in an accepting state.
    For maximum
    concurrency we actually reclaim the underlying pooled connection
    as
    soon
    as the
    fate of the transaction is sealed. This means that the warnings itmay
    have accrued
    are no longer accessible to the client. This is because we turn offthe
    wrapper
    object that the client has (generating that exception), and for pool
    cleanliness
    we always clear any warnings the connection may have collected during

  • Commit/Rollback in EclipseLink

    Hi,
    Most of my changes are wrapped in a pair of
    EntityManagerHelper.beginTransaction();
    save(entity);//or delete(), update(), ...
    EntityManagerHelper.commit();
    How do I handle exceptions and rollbacks?
    In the above example, do I catch all exceptions (ie, Throwable) and do a rollback (EntityManagerHelper.rollback())?
    Without any rollbacks, EclipseLink complains about inconsistant transactions (already in a transaction), when failures occur.
    Regards,
    Ramin

    Hello,
    EclipseLink unit tests generally wrap test code within a try/catch block an call:
    if (getEntityManager().getTransaction().isActive()){
    getEntityManager().getTransaction().rollback();
    at the end to rollback the transaction if it hasn't already. The if statement will prevent rolling back the transaction if it is not active.
    Most JPA exceptions should mark the transaction for rollback already though, as per the spec:
    "All instances of PersistenceException except for instances of NoResultException, NonUniqueResultException, LockTimeoutException, and
    QueryTimeoutException will cause the current transaction, if one is active, to be marked for rollback."
    Best Regards,
    Chris

  • ROLLBACK after failure

    I am calling the following FMs in the sequence:
    1. BAPI_GOODSMVT_CREATE using movement type 261
    2. BAPI_GOODSMVT_CREATE using movement type 101
    3. COMMIT WORK to generate a handling unit number.
    4. A FM L_TO_CREATE_SINGLE (that unpacks and repacks handling units) uses the handling unit number of step 3.
    My requirement is that if the BDC in the 4th step fails, then steps 1, 2 should be be ROLLBACKed.
    To my understanding if I have a ROLLBACK work after step 4, then the COMMIT work in step 3 prevents the ROLLBACK of steps 1 and 2.
    I cannot remove the COMMIT in step 3 as the HU number is not being generated (which I need in step 4) in case I remove the COMMIT WORK.      
    I tried calling the FM in step 4 in UPDATE TASK, but no luck.
    Please help, how to go about this problem.

    You are using commit work before step 4 because you step 4 is dependent on data provided from previous steps.
    My requirement is that if the BDC in the 4th step fails, then steps 1, 2 should be be ROLLBACKed.
    Commit work is the last state of a transaction flow and you cannot rollback the previous step. The only way I see is to call BAPI_GOODSMVT_CANCEL and reverse the goods movement.
    Please let me know what do you mean by logs exactly. Is it the change documents or something else ?
    Kesav

  • FRM-99999 ERRORE 408 OCCURRED FRM-40655 SQL ERROR FORCED ROLLBACK CLEAR FRO

    Dear Friends
    I am getting this FRM-99999 ERRORE 408 OCCURRED FRM-40655 SQL ERROR FORCED ROLLBACK CLEAR FROM AND RE-ENTER TRANACTION.
    FRM-40512 ORACLE ERROR UNABLE TO ISSUE SAVE POINT COMAND.
    I am calling the form using the following script :
    :global.command_line := 'C:\SALES\NEW_ITEMS.FMX' ;
    CALL_FORM(:global.command_line);
    go_block('COP_ORDER_DETAILS');
    go_record(:global.l_n_curr_rec2);
    :COP_ORDER_DETAILS.ITEM_CODE :=:GLOBAL.ITEM_CODE_VAR;
    :COP_ORDER_DETAILS.COLOR := :GLOBAL.COLOR_CODE ;
    :COP_ORDER_DETAILS.SHAPE_CODE := :GLOBAL.SHAPE_CODE ;
    :COP_ORDER_DETAILS.DELIVERY_QUANTITY := :GLOBAL.QTY ;
    :COP_ORDER_DETAILS.VOLUME := :GLOBAL.VOLUME;
    It works fine for one record, when I try to create another record by calling the called form it gives the above messages.
    Waiting for your valuable replay.
    Best regards
    Jamil

    This happens due to dead lock situation
    To avoid this problem, add NOWAIT option to the UPDATE and DELETE statements, which returns ORA-00054 error, trap this error and display user defined message like 'The record is being accessed and try after some time'.
    This even improves the performance
    because no process waits for the locks preventing dead locks.
    If it is due to the UPDATE's or DELETE's with base table blocks in the form, in the PRE-UPDATE and PRE-DELETE triggers write SELECT statements to select the particular row with FOR UPDATE NO WAIT option. Handle by trapping the ORA-00054 error

Maybe you are looking for

  • Pointer disappears after sleep...

    The pointer disappears, sometimes when G4 is woken up. If I wait a minute or so it reappears. Is this a mouse issue, or PRAM?......appreciate any suggestions

  • Read material sales text

    Hi, We need to retrieve Material Sales Text for thousands of materials.We are using the function module READ_TEXT to retrieve text one material at a time.Is there any best possible way of handling this? like  retrieving sales text for bunch of materi

  • Adobe form - Split internal table data & dis on the right and left corner

    HI , I have a form where i am populating the data via an Internal Table. The concern i have is i have 100 rows in the table and i want to print the first 10 rows on the right hand side of the page and the next 10 rows on the Left hand side of the pag

  • "Perform whole database Recovery" Host Credentials problem

    Hello, I have minimal knowledge of the Oracle database system but currently I need to recover a Oracle 10G database on a Windows Server 2003 Standard edition. Im trying to use the Oracle Enterprise Manager. Im logged into the instance with SYS as SYS

  • How to display BarChart, SPC Chart in EP?

    hi, how to display charts e.g.:Barcharts,SPC analysis Charts etc in EP ? anyone can help regarding this. regards suresh hiremath<b></b>