Problem with RollBack in  Oracle Batching

Hi all,
This is Adhil. I am facing a problem with Oracle Batching in java.
I am using java 1.5 and Oracle 10 g.
I have a below standalone code to test the Oracle Batching (Assume that i have the 2 tables with zero records ).
with the batch size set as 10, I am trying add 2 records in each table.
Now I rise divideByZero error exception manually and trying to rollback the connection in catch statement . But couldn't rollback the connection. I see the 2 records added in both of my tables.
The same code when i set the batchsize 2 and trying to insert 10 records ,I could rollback and no rows get inserted.
Since I am going to get the no of insert from user in runtime , my rollback may fail in any combinations as in my first case(with batch size 10 and if the no of insert is 2).
import java.io.*;
import java.util.*;
import java.sql.*;
import oracle.jdbc.*;
public class BatchTest{
     public static void main(String args[]) throws Exception{
          Connection conn = null;
          conn = new BatchTest().createConnection();
          new BatchTest().insertdata(conn);
     public Connection createConnection() throws Exception{
               Properties props =new Properties();
               props.load(ClassLoader.getSystemResourceAsStream("connection.properties"));
               String connectionString = (String)props.get("connection");
               String username = (String)props.get("username");
               String password = (String)props.get("password");
               Class.forName("oracle.jdbc.driver.OracleDriver");
               Connection connection = DriverManager.getConnection(connectionString, username, password);
               return connection;
     public void insertdata(Connection dbConnection){
          PreparedStatement psCnt =null;
          PreparedStatement psImp =null;
          try{
          dbConnection.setAutoCommit(false);
          psCnt = dbConnection.prepareStatement("insert into CHKCNT values (?,?)");
          psImp = dbConnection.prepareStatement("insert into CHKIMP values (?,?)");
          ((OraclePreparedStatement)psCnt).setExecuteBatch (10);
          ((OraclePreparedStatement)psImp).setExecuteBatch (10);
          int x=0;
          for(int i=1;i<=2;i++){
                    psCnt.setInt(1,i);
                    psCnt.setString(2,"Jack");
                    psImp.setInt(1,i);
                    psImp.setString(2,"John");
                    psImp.executeUpdate();
                    psCnt.executeUpdate();
          if(true) x=10/0;
          dbConnection.commit();
          }catch(Exception e){
               try{
               dbConnection.rollback();
               dbConnection.close();
               }catch(Exception ex){
               e.printStackTrace();
          }finally{
               try{
                    psCnt.close();
               }catch(Exception ee){
               ee.printStackTrace();
Can anyone suggest me a way to make my rollback work.
Thanks in advance.
-adhil.J

Hi all,
This is Adhil. I am facing a problem with Oracle Batching in java.
I am using java 1.5 and Oracle 10 g.
I have a below standalone code to test the Oracle Batching (Assume that i have the 2 tables with zero records ).
with the batch size set as 10, I am trying add 2 records in each table.
Now I rise divideByZero error exception manually and trying to rollback the connection in catch statement . But couldn't rollback the connection. I see the 2 records added in both of my tables.
The same code when i set the batchsize 2 and trying to insert 10 records ,I could rollback and no rows get inserted.
Since I am going to get the no of insert from user in runtime , my rollback may fail in any combinations as in my first case(with batch size 10 and if the no of insert is 2).
import java.io.*;
import java.util.*;
import java.sql.*;
import oracle.jdbc.*;
public class BatchTest{
     public static void main(String args[]) throws Exception{
          Connection conn = null;
          conn = new BatchTest().createConnection();
          new BatchTest().insertdata(conn);
     public Connection createConnection() throws Exception{
               Properties props =new Properties();
               props.load(ClassLoader.getSystemResourceAsStream("connection.properties"));
               String connectionString = (String)props.get("connection");
               String username = (String)props.get("username");
               String password = (String)props.get("password");
               Class.forName("oracle.jdbc.driver.OracleDriver");
               Connection connection = DriverManager.getConnection(connectionString, username, password);
               return connection;
     public void insertdata(Connection dbConnection){
          PreparedStatement psCnt =null;
          PreparedStatement psImp =null;
          try{
          dbConnection.setAutoCommit(false);
          psCnt = dbConnection.prepareStatement("insert into CHKCNT values (?,?)");
          psImp = dbConnection.prepareStatement("insert into CHKIMP values (?,?)");
          ((OraclePreparedStatement)psCnt).setExecuteBatch (10);
          ((OraclePreparedStatement)psImp).setExecuteBatch (10);
          int x=0;
          for(int i=1;i<=2;i++){
                    psCnt.setInt(1,i);
                    psCnt.setString(2,"Jack");
                    psImp.setInt(1,i);
                    psImp.setString(2,"John");
                    psImp.executeUpdate();
                    psCnt.executeUpdate();
          if(true) x=10/0;
          dbConnection.commit();
          }catch(Exception e){
               try{
               dbConnection.rollback();
               dbConnection.close();
               }catch(Exception ex){
               e.printStackTrace();
          }finally{
               try{
                    psCnt.close();
               }catch(Exception ee){
               ee.printStackTrace();
Can anyone suggest me a way to make my rollback work.
Thanks in advance.
-adhil.J

Similar Messages

  • Problems with Download of Oracle IFS /IFS Devkit for NT

    I am having problems with download of Oracle IFS and Oracle IFS Devkit for NT.
    When I ran the ifsdevkit.bat file the last four files did not get copied over. Subsequently when I ran the upload_ifsdevkit batch file as indicated in document I got error message saying
    'System cannot find the path specified'.
    When I opened the batch file it is looking for BIN directory under the C:\OraHome1\ifs directory but none exists. I wonder if this is the cause of problem. This would mean that the ifs1081.zip file has a bug in that it did not create the BIN directory and files under C:\OraHome1\ifs
    Would appreciate if somebody can help. Thanks
    null

    Is C:\OraHome1 your ORACLE_HOME directory? (Usually, it's C:\Oracle\Ora81)
    Also, have you installed iFS (successfully) in that ORACLE_HOME? If so, you are guaranteed to have an %ORACLE_HOME%\ifs\bin directory.
    Finally, did you enter the correct directory as the parameter to the DEVKIT script?

  • Problem with implicitly created Oracle pipes

    Hi, I am having a problem with implicitly created Oracle pipes. I am not sure if this is the correct forum for this topic, but I could not see one which suited better..
    I am using Oracle pipes as a commiunication mechanism between processes (some are written in PL/SQL and other in PRO*C).
    The general problem I have is that if a timeout occurs during the communication process, I end up with 1 or perhaps 2 implicitly created pipes.
    The biggest problem for me is that I am unable to determine if a create is implicitly created (via dbms_pipe.send_message or receive_message). This causes problems, since these implicitly created pipes are left behind and not deleted. I'll show you the basic flow of the processes and you shall see my problem.
    server: create request pipe "req_pipe"
    server: listen for request on requests pipe.
    client: create two pipes for comms with server.
    client: send request and the names of the newly created pipes to the server.
    server: read request and pipename from request pipe (from this point all comms between the client and server are now done over the 2 pipes the client created).
    server: send ack message to client to ensure they are still there (since requests can be queued in the request pipe and clients could have timed out before the request is received)
    client: send "i'm still here" ack back to the server.
    server: process request and send result back to client.
    client: send ack back to server to let server know we have received the response.
    server: send ack back to client to show that work is now committed.
    OK thats the general event flow. I use the rule, that pipes created by a process are removed by a process. So the client always removes the pipes it created in all situations. But since this can happen at any point we can get in the situation:
    client: timeout occurs, delete pipes.
    server: send message to client (creates an implicit pipe) and therefor works (no errors raised)
    server: do a read for response from previous message. (implicitly creates pipe) (will fail).
    Now we have two implicitly created pipes! These pipes will exist until the database instance is shutdown, and in a poorly performing environment, we could get thousands of these pipes lying around... not a good situation.
    How can I either stop pipes being implicilty created, or how do I detect if a pipe was implicitly created.
    I have tried a couple of things, like using v$db_pipes to check if a pipe exists before doing send/reveive calls but this is FAR to slow to do a select on that view.
    We have also looked at keeping a record of pipes created by the client then have some process (perhaps the server) clean up these pipes after some time frame. This is a workable solution but is not favourable since it adds extra overhead having to check these pipes often, and created an extra level of complexity which is not required..
    Any suggestions will be greatly appreciated.
    Feel free to email me with any suggestions on my email provided below, or just post a reply to this formum..
    Many thanks,
    Karl Bridger
    [email protected]

    I solved the problem by changing the SOAP massage format from Document/Wrapped to Document/Literal

  • Problem with query for Oracle

    Hello Experts,
    I'm tryng to develop my first application for EP (v7 SP12) with NWDS (without NWDI).
    This application has to read and write data in the EP DB (oracle v10).
    I'm using:
    <u>a Dictionary Project</u> (define the DB Tables)
    <u>a Java Project</u> (define class as DAO, DBManager etc)
    <u>a Library Project</u>
    <u>an EJB Project</u>
    <u>an EAR Project</u>
    With these projects I can deploy a <u>webService</u> in my EP server.
    BUT I have some problem with a query that I'm tryng to sent to my DB through a DAO Class called by my WebService.
    The query is simple and correct but it does not work...
    This is the error message returned (the query id in bold)
    (column names: GIORNO, NOMEDITTA, NOMEAREA, NOMESETTORE)
    <i>HTTP/1.1 500 Internal Server Error
    Connection: close
    Server: SAP J2EE Engine/7.00
    Content-Type: text/xml; charset=UTF-8
    Date: Fri, 21 Sep 2007 14:29:57 GMT
    Set-Cookie: <value is hidden>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>java.sql.SQLException: com.sap.sql.log.OpenSQLException: The SQL statement <b>"SELECT NOMESETTORE, MIN(? - "GIORNO") AS GIORNI FROM SRS_DATEINFORTUNI WHERE NOMEDITTA = ? AND NOMEAREA= ? GROUP BY NOMESETTORE ORDER BY NOMESETTORE"</b> <u>contains the syntax error[s]: - 1:25 - the arithmetic expression >>? - "GIORNO"<< contains a host variable (parameter marker)</u></faultstring><detail><ns1:getGiorniSettori_com.akhela.giorniSenzaInfortuni.ejb.exception.GiorniSenzaInfortuniException xmlns:ns1='urn:GiorniSenzaInfortuniWSWsd/GiorniSenzaInfortuniWSVi'></ns1:getGiorniSettori_com.akhela.giorniSenzaInfortuni.ejb.exception.GiorniSenzaInfortuniException></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope></i>
    The variable '?' is the today date, the difference <b>"(?-GIORNO)"</b> is an int..
    Moreover in my DAO class the query is <b>"SELECT NOMESETTORE, MIN(? - GIORNO) AS GIORNI FROM SRS_DATEINFORTUNI WHERE NOMEDITTA = ? AND NOMEAREA= ? GROUP BY NOMESETTORE ORDER BY NOMESETTORE</b>", instead in the error message is reported <b>MIN(? - "GIORNO")</b>...
    We have tryed also with alternative query, for example we used <b>"MIN(SYSDATA - GIORNO)"</b> but <b>SYSDATA</b> was interpreted as column name and  not found....
    Any help???
    Best Regards

    Hi, I found something about the Host Variable (http://help.sap.com/saphelp_nw70/helpdata/en/ed/dbf8b7823b084f80a6eb7ad43bdbb9/content.htm), there explain that if you want to use an host variable you have to put ':' as prefix..
    My problem is that <u>I need to extract the minimum of the subtraction between two dates:</u>
    Query <b>MIN(? - GIORNO)</b> --> <i>Error: the arithmetic expression >>? - "GIORNO"<< contains a host variable (parameter marker)</i>
    So I tried to use the ':' as indicated in the manual..
    <b>MIN:(? - GIORNO)</b> --> - <i>SQL syntax error: the token ":" was not expected here
                   - expecting LPAREN, found ':'</i>
    <b>MIN(:(? - GIORNO))</b> --> <i>- 1:25 - Open SQL syntax error: :PARAMETER not allowed
                   - 1:26 - SQL syntax error: the token "(" was not expected here
                   - 1:26 - expecting ID, found '('</i>
    Then I tried to avoid the MIN() function and I tried to do just the subtraction:
    <b>? - GIORNO</b> --><i> - 1:21 - the arithmetic expression >>? - "GIORNO"<< contains a host variable (parameter marker)</i>
    <b>:(? - GIORNO)</b> --> <i>- 1:21 - Open SQL syntax error: :PARAMETER not allowed
                - 1:22 - SQL syntax error: the token "(" was not expected here
                - 1:22 - expecting ID, found '('</i>
    <b>'2007-09-24' - GIORNO</b> --> <i>- 1:34 - SQL syntax error: first argument of operator "-" must be a number, date/time or interval
                     - 1:43 - SQL syntax error: arguments of operator "-" do not have correct types
                     - 1:43 - SQL syntax error: derived columns in SELECT list with AS must be values</i>
    <b>GIORNO - GIORNO</b> --> <i>- 1:21 - the group by list and the select list are inconsistent: the column >>"GIORNO"<< is neither grouped nor aggregated
                  - 1:30 - the group by list and the select list are inconsistent: the column >>"GIORNO"<< is neither grouped nor aggregated</i>
    Why these parts of query are not accepted???
    I don't understand why... I hope you can help me.
    Best Regards
    Alessandro

  • Problem with RoboHelp 7 and Batch Generate "Printed Documentation"

    Hello people! I have a problem with Batch Generate of Word documenttion in RoboHelp 7, when launch the Batch Generate with "Printed Documention"  option selected send me a error message like this "Adobe Acrobat or Adobe Elments version 7 or Higher is not installed on your system".
    RoboHelp generate de .chm file without problems.
    I have the last version of Adobe Acrobat Reader Installed in my computer, my RoboHelp's project is not very complicated, the only to remarks is in spanish lenguage and the computer is in spanish too, but anothers projects in english US generate documentation without problems, I dont know if this had anything to do..
    I have windows XP SP 3,so I test in another computer to generate documentation and I have the same problem. What´s happend ?? 
    Thank you for all.

    I too am having this issue with the TOC. Firefox simply
    doesn't handle it correctly and I have no idea how to fix
    it.

  • Problem with rollback

    Hello,
    I have this query
    DECLARE @TransactionName varchar(20) = 'inlinefunctionTransaction';
    begin tran @TransactionName
     select * from jsp('S1','P1');
    ROLLBACK TRAN @TransactionName;
    go
    but when executing it I get a message
    Cannot roll back inlinefunctionTransaction. No transaction or savepoint of that name was found. 
    Can anybody explin me please what's going wrong?
    Thanks

    Thanks, but I tried with
    DECLARE
    @TransactionName
    varchar(40)='infTransaction';
    but again happened, so the varchar od 20 was not the problem.I have begin tran for several dierent procedures. All of them start with
    DECLARE
    @TransactionName
    varchar(40)='infTransaction';
    begin
    tran
    @TransactionName
    but only the last function ends with
    ROLLBACK
    TRAN
    @TransactionName;
    and all the procedures end with go, which I don't know whether is ok.
    Thanks

  • Problem with XMLDOM package (Oracle 10.2.0.1.0)

    Hi,
    I am using the dbms_xmldom package to generate xml files (specific structure).
    Below is the code but It produces nothing (dbms_output does not return) :
    DECLARE
    doc xmldom.DOMDocument;
    main_node xmldom.DOMNode;
    root_node xmldom.DOMNode;
    root_elmt xmldom.DOMElement;
    transmissionHeaderNode xmldom.DOMNode;
    transmissionHeaderElement xmldom.DOMElement;
    item_node xmldom.DOMNode;
    item_elmt xmldom.DOMElement;
    item_text xmldom.DOMText;
    buffer_problem CLOB;
    BEGIN
    doc := xmldom.newDOMDocument;
    main_node := xmldom.makeNode(doc);
    xmldom.setversion(doc,'1.0');
    root_elmt := xmldom.createElement(doc, 'InvoiceTransmission');
    root_node := xmldom.appendChild( main_node, xmldom.makeNode(root_elmt));
    transmissionHeaderElement := xmldom.createElement(doc, 'TransmissionHeader');
    transmissionHeaderNode := xmldom.appendChild(root_node, xmldom.makeNode(transmissionHeaderElement));
    item_elmt := xmldom.createElement(doc, 'TransmissionDateTime');
    item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    item_text := xmldom.createTextNode(doc, TO_CHAR(SYSDATE,'DD-MM-YYYY'));
    item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    item_elmt := xmldom.createElement(doc, 'IssuingOrganiszationID');
    item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    item_text := xmldom.createTextNode(doc,'0258');
    item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    item_elmt := xmldom.createElement(doc, 'Version');
    item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    item_text := xmldom.createTextNode(doc, 'IATA:ISXMLInvoiceV3.0');
    item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    xmldom.writetobuffer(doc, buffer_problem);
    dbms_output.put_line(buffer_problem);
    xmldom.freeDocument(doc);
    END;
    That's strange because when remove a code part like :
    item_elmt := xmldom.createElement(doc, 'Version');
    item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    item_text := xmldom.createTextNode(doc, 'IATA:ISXMLInvoiceV3.0');
    item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    I can get the ouput xml :
    <?xml version="1.0"?>
    <InvoiceTransmission>
    <TransmissionHeader>
    <TransmissionDateTime>26-10-2010</TransmissionDateTime>
    <IssuingOrganiszationID>0258</IssuingOrganiszationID>
    </TransmissionHeader>
    </InvoiceTransmission>
    I don't if it's a problem with xmldom or with dbms_output package...
    Please someone can help me ?

    Works fine for me
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    SQL> set serveroutput on;
    SQL>
    SQL> DECLARE
      2     doc xmldom.DOMDocument;
      3     main_node xmldom.DOMNode;
      4     root_node xmldom.DOMNode;
      5     root_elmt xmldom.DOMElement;
      6 
      7     transmissionHeaderNode xmldom.DOMNode;
      8     transmissionHeaderElement xmldom.DOMElement;
      9     item_node xmldom.DOMNode;
    10     item_elmt xmldom.DOMElement;
    11     item_text xmldom.DOMText;
    12 
    13     buffer_problem CLOB;
    14 
    15  BEGIN
    16 
    17     doc := xmldom.newDOMDocument;
    18     main_node := xmldom.makeNode(doc);
    19     xmldom.setversion(doc,'1.0');
    20     root_elmt := xmldom.createElement(doc, 'InvoiceTransmission');
    21     root_node := xmldom.appendChild( main_node, xmldom.makeNode(root_elmt));
    22 
    23     transmissionHeaderElement := xmldom.createElement(doc, 'TransmissionHeader');
    24     transmissionHeaderNode := xmldom.appendChild(root_node, xmldom.makeNode(transmissionHeaderElement));
    25 
    26     item_elmt := xmldom.createElement(doc, 'TransmissionDateTime');
    27     item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    28     item_text := xmldom.createTextNode(doc, TO_CHAR(SYSDATE,'DD-MM-YYYY'));
    29     item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    30 
    31     item_elmt := xmldom.createElement(doc, 'IssuingOrganiszationID');
    32     item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    33     item_text := xmldom.createTextNode(doc,'0258');
    34     item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    35 
    36     item_elmt := xmldom.createElement(doc, 'Version');
    37     item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
    38     item_text := xmldom.createTextNode(doc, 'IATA:ISXMLInvoiceV3.0');
    39     item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
    40 
    41     --buffer_problem := 'a';  -- added to initialize clob
    42     xmldom.writetobuffer(doc, buffer_problem);  -- change to writetoclob
    43     dbms_output.put_line(buffer_problem);
    44     xmldom.freeDocument(doc);
    45 
    46  END;
    47  /
    <?xml version="1.0"?>
    <InvoiceTransmission>
      <TransmissionHeader>
        <TransmissionDateTime>26-10-2010</TransmissionDateTime>
        <IssuingOrganiszationID>0258</IssuingOrganiszationID>
        <Version>IATA:ISXMLInvoiceV3.0</Version>
      </TransmissionHeader>
    </InvoiceTransmission>Suggestions:
    - Use dbms_xmldom instead of just xmldom. Oracle changed the name in the 9i days and xmldom is a synonym to dbms_xmldom.
    - Use .writeToClob intead of .writeToBuffer
    - I would suggest trying to upgrade to .4 as you pick up a lot of improvements and bug fixes. Whether what you are encountering is a bug I cannot say but would seem so.
    - See the FAQ under your sign-in name to learn how to use the tag to format the code like I did above.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem with WMS themes & Oracle MapViewer Version 11.1.1.2

    Hello, in my application I load the background raster from a external server using wms. With differents version of mapviewer 11 with a weblogic server (e.g: release 1, release 11.1.1.4) all it's allrigth, but when I change the mapviewer to release 11.1.1.2 I can't see the raster and I get the next error:
    21-sep-2011 11:33:10 oracle.sdovis.theme.WMSMapThemeDefinition setSrs
    INFO: Theme SRID set to 23030 for EPSG 82337
    21-sep-2011 11:33:10 oracle.sdovis.theme.WMSMapThemeProducer prepareData
    SEVERE: MAPVIEWER-01048: Cannot load WMS map image.
    21-sep-2011 11:33:10 oracle.sdovis.theme.DynGeomThemeProducer prepareData
    I can understand why..., I don't know what's is the problem because differents versions of mapviewer work without problem on the same weblogic server (Weblogic 11 patchset R2).
    Anyone know if mapviewer 11.1.1.2 has a problem with WMS?
    Thanks for your answer!!

    although with Oracle Fusion Middleware MapViewer Version 11g ps3 (11.1.1.4) and 11g ps4 (11.1.1.5.1) everything work ok in my WebLogic Server: 10.3.3.0, with Mapviewer Version 11.1.1.2 I get the next error:
    29-sep-2011 13:25:53 oracle.sdovis.theme.WMSMapThemeDefinition setSrs
    INFO: Theme SRID set to 23030 for EPSG 82337
    sun.awt.image.ImageFormatException: Not a JPEG file: starts with 0xff 0xd9
         at sun.awt.image.JPEGImageDecoder.readImage(Native Method)
         at sun.awt.image.JPEGImageDecoder.produceImage(JPEGImageDecoder.java:119)
         at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:246)
         at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
         at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
    29-sep-2011 13:25:53 oracle.sdovis.theme.WMSMapThemeProducer prepareData
    SEVERE: MAPVIEWER-01048: Cannot load WMS map image.
    I've seen that the wms external service works ok and returns an url with the correct image, but something wrong happens inside of mapviewer that don't allow generate the image....

  • Problems with Enterprise Manager Oracle 10gR2

    Hi,
    The installation of 10gR2 on Windows 2000 seems to work.
    I only have a problem with web enterprise manager.
    I can connect to the database correctly and I can manage the database (creating tables, users and so on).
    The only problem is in the first page (home) of the database, accessing with the web enterprise manager.
    In fact I get this "error: java.lang.Exception: IOException in sending Request :: Connection refused", but I however access the db.
    I verified the DBSNMP user and it's active.
    Did someone get the same error?
    Excuse if I'm repeating a previous post, but I received answers about linux environment only (I have Windows 2000 server, instead).
    thanks a lot,
    Francesco

    We have in fact seen the same error. In our case, it appeared after the network guys moved the Oracle server from one domain to another. (This is not an action that I highly recommend, by the way.)
    I used emca to delete the Enterprise Manager agent and recreate it. For a single instance server not in a cluster or on a grid, the commands look like this:
    emca -deconfig dbcontrol db
    emca -config dbcontrol db
    That worked just fine. However, we started getting an "account locked" error when the Enterprise Manager started. And the result is the same as you described. The account is not locked by any means. If you ignore what you see on the screen about an error, you can go on and administer the database just fine. It's just when you get back to the home screen, it tells you that your account is locked and you are not in touch with the instance.
    I can make the error go away for awhile by stopping and starting the agent with
    emctl stop dbconsole
    emctl start dbconsole
    But the error comes back in a little while.
    We don't consider it a show stopper, since the database performs normally. It's just one of those things you wish it would not do.

  • Problem with javascript/PHP/ oracle 10g smart quotes

    I have a problem with my php form that passes the text field to a javascript object. When I copy text from MS Word that includes smart quotes, the form inputs that into the database as ? (upside down) marks. The charset of the DB is WE8MSWIN1252. How do I store these smart quotes as regular quotes? And also if I can do any conversions on the front end (js or php). I tried doing some conversion but to no avail. Any help would be appreciated thank you. “double”

    Decide if you want your HTML pages in Windows code page 1252 or Unicode UTF-8. Then, make sure the pages are properly tagged as either "text/html;charset=windows-1252" or "text/html;charset=utf-8". Use HTTP header Content-type or the corresponding <META HTTP-EQUIV=...> tag. Then, set NLS_LANG environment variable for your PHP engine to either AMERICAN_AMERICA.WE8MSWIN1252 or to AMERICAN_AMERICA.AL32UTF8, depending on which encoding you selected for your HTML.
    -- Sergiusz

  • Problems with a session of batch input - In processing

    Hello!
    I have a problem with a depreciation posting Session (AFAB). User has stoped the process of session and now the status is 'In Processing' and we can't run it anymore...
    ¿How I can process this Session?
    I've tried to delete the session and re-run the depreciation posting, but it's not working.
    I've tried to delete in TABA table the line of this period, but it's not working.
    I've tried to suicide me, but... it's not working.
    I'll try to kill the user, I hope that It will work.
    Can you help me? Please.
    Thanks a lot!!!

    Dear Jorge,
    In SM35 analyze your session.
    If it was processed in background go to transaction SM37. Else, you can proceed in SM35 itself.
    Regards,
    Naveen.

  • Problem with Unicode and Oracle NCLOB fields

    When I try to INSERT a new (N)CLOB into an Oracle database, all is fine until I use a non-ASCII character, such as an accented roman letter, like the "�" (that's '\u00E9') in "caf�" or the Euro Currency symbol "?" (that's '\u20AC' as a Java character literal, just in case the display is corrupted here too). This doesn't happen with "setString", but does happen when streaming characters to the CLOB; however, as Oracle or the driver refuse strings larger than 4000 characters, and as I need to support all the above symbols (and many more), I'm stuck.
    Here's the background to the problem (I've tried to be detailed, after a lot of looking around on the web, I've seen lots of people with similar problems, but no solutions: I've seen and been able to stream ASCII clobs, or add small NCHAR strings, but not stream NCLOBs...).
    I'm using Oracle 9.2.0.1.0 with the "thin" JDBC driver, on a Windows box (XP Pro). My database instance is set up with AL32UTF8 as the database encoding, and UTF8 as the national character set.. I've created a simple user/schema, called LOBTEST, in which I created two tables (see below).
    The basic problems are :
    - with Oracle and JDBC, you can't set the value of a CLOB or NCLOB with PreparedStatement's setString or setCharacterStream methods (as it throws an exception when you send more than 4000 characters)
    - with Oracle, you can only have one LONG VARCHAR-type field per table (according to their documentation) and you MUST read all columns in a set order (amongst other limitations).
    - with a SQL INSERT command, there's no way to set the value of a parameter that's a CLOB (implementations of the CLOB interface can only be obtained by performing a SELECT.... but obviously, when I'm inserting, the record doesn't exist yet...). Workarounds include (possibly) JDBC 4 (doesn't exist yet...) or doing the following Oracle-specific stuff :
    INSERT INTO MyTable (theID,theCLOB) VALUES (1, empty_clob());
    SELECT * FROM MyTable WHERE theId = 1;
    ...and getting the empty CLOB back (via a ResultSet), and populating it. I have a very large application, that's deployed for many of our customers using SapDB and MySQL without a hitch, with "one-step" INSERTS; I can't feasibly change the application into "three-step INSERT-SELECT-UPDATE" just for Oracle, and I shouldn't need to!!!
    The final workaround is to use Oracle-specific classes, described in:
    http://download-east.oracle.com/otn_hosted_doc/jdeveloper/904preview/jdbc-javadoc/index.html
    ...such as CLOB (see my example). This works fine until I add some non-ASCII characters, at which point, irrespective of whether the CLOB data is 2 characters or 2 million characters, it throws the same exception:
    java.io.IOException: Il n'y a plus de donn?es ? lire dans le socket
         at oracle.jdbc.dbaccess.DBError.SQLToIOException(DBError.java:716)
         at oracle.jdbc.driver.OracleClobWriter.flushBuffer(OracleClobWriter.java:270)
         at oracle.jdbc.driver.OracleClobWriter.flush(OracleClobWriter.java:204)
         at scratchpad.InsertOracleClobExample.main(InsertOracleClobExample.java:61)...where the error message in English is "No more data to read from socket". I need the Oracle-specific "setFormOfUse" method to force it to correctly use the encoding of the NCLOB field, without it, even plain ASCII data is rejected with an exception indicating that the character set is inappropriate. With a plain CLOB, I don't need it, but the plain CLOB refuses my non-ASCII data anyway.
    So, many many thanks in advance for any advice. The remainder of my post includes my code example and a simple SQL script to create the table(s). You can mess around with the source code to test various combinations.
    Thanks,
    Chris B.
    CREATE TABLE NCLOBTEST (
         ID         INTEGER NOT NULL,
         SOMESTRING NCLOB,
         PRIMARY KEY (ID)
    CREATE TABLE CLOBTEST (
         ID         INTEGER NOT NULL,
         SOMESTRING CLOB,
         PRIMARY KEY (ID)
    package scratchpad;
    import java.io.Writer;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    import java.util.Properties;
    import oracle.jdbc.driver.OracleDriver;
    import oracle.jdbc.driver.OraclePreparedStatement;
    import oracle.sql.CLOB;
    public class InsertOracleClobExample
         public static void main(String[] args)
              Properties jdbcProperties = new Properties();
              jdbcProperties.setProperty( "user", "LOBTEST" );
              jdbcProperties.setProperty( "password", "LOBTEST" );
    //          jdbcProperties.setProperty("oracle.jdbc.defaultNChar","true");
              Driver jdbcDriver = new OracleDriver();
              PreparedStatement pstmt = null;
              Connection connection = null;
              String tableName = "NCLOBTEST";
              CLOB clob = null;
              try
                   connection = jdbcDriver.connect("jdbc:oracle:thin:@terre:1521:orcl", jdbcProperties);
                   pstmt = connection.prepareStatement("DELETE FROM NCLOBTEST");
                   pstmt.executeUpdate();
                   pstmt.close();
                   pstmt = connection.prepareStatement(
                        "INSERT INTO "+tableName+" (ID,SOMESTRING) VALUES (?,?);"
                   clob = CLOB.createTemporary(pstmt.getConnection(), true, CLOB.DURATION_SESSION);
                   clob.open(CLOB.MODE_READWRITE);
                   Writer clobWriter = clob.getCharacterOutputStream();
                   clobWriter.write("Caf? 4,90? TTC");
                   clobWriter.flush();
                   clobWriter.close();
                   clob.close();
                   OraclePreparedStatement opstmt = (OraclePreparedStatement)pstmt;
                   opstmt.setInt(1,1);
                   opstmt.setFormOfUse(2, OraclePreparedStatement.FORM_NCHAR);
                   opstmt.setCLOB(2, clob);
                   System.err.println("Rows affected: "+opstmt.executeUpdate());
              catch (Exception sqlex)
                   sqlex.printStackTrace();
                   try     {
                        clob.freeTemporary();
                   } catch (SQLException e) {
                        System.err.println("Cannot free temporary CLOB: "+e.getMessage());
              try { pstmt.close(); } catch(SQLException sqlex) {}
              try { connection.close(); } catch(SQLException sqlex) {}
    }

    The solution to this is to use a third-party driver. Oranxo works really well.
    - Chris

  • "Problem with links in Oracle 10g Express Edition Application Interface"

    Hi.
    Under Object_Interface>Browse>Procedure the "edit" and "compile" links are not working.Also I am unable to see my code when I click on one of the procedures. Kindly help me out.
    Thanks & Regards
    Sri

    My laptop didn't start this morning. Can you help me out?
    (Go to the Express Edition forum at Oracle Database Express Edition (XE) and give them some hints about what the problem is. )
    At the very least you will need to tell people: operating system, browser, whether you have Firewall turned on, whether you are using anti0virus, whether yo have upgraded the Application Express interface.
    You can volunteer that information, or you can wait until people ask for it, but you will need to provide that information. And if you force people to ask - it's quite likely they will get bored with your problem.

  • Problem with rollback in EJB and CMT

    Hello,
    I faced a problem in my application that I really do not understand (but I really would like to). How can I trigger a rollback of a transaction that is container-managed (CMT)? I know that any system exceptions are supposed to be handled by the container automatically and will cause a transaction rollback when they are thrown from an enterprise bean method. My Problem now is that I'm unable to make this work in my application.
    Consider a situation like this:
    The ManageEntityBean holds a simple save() method that creates an instance of EntityA and another of EntityB. Both instances store an arbitrary number (here 10). After this, the entityManger (injected from the container) is asked to make these instances persistent. EntityB is mapped with a "unique" constraint, so any attempt to store the same number twice will cause an SQL Exception.
    First time when the save() method is invoked, the instances aEntity and bEntity are made permanent in the database. Second time when the save() method is invoked, the database throws an exception because bEntity is violating the unique constraint. What I would expect now is a complete rollback of the whole transaction. Instead, only bEntity has not been made permanent, but aEntity has.
    What's wrong with this code?
    @Stateless
    public class ManageEntityBean implements ManageEntity {
         @PersistenceContext
         private EntityManager entityManager;
         @TransactionAttribute(TransactionAttributeType.REQUIRED)
         public void save() {
              try {
                   EntityA aEntity = new EntityA(10);
                   EntityB bEntity = new EntityB(10);
                    entityManager.persist(aEntity);
                    entityManager.persist(bEntity);
              } catch (Exception e) {
                   throw new EJBException(e);
    @Entity
    public class EntityA implements java.io.Serializable {
         @Id
         @GeneratedValue
         private long     id;
            @Column(name="NUMBER")
            private int   number;
         public EntityA() {}
         public EntityA(int number) {
              this.number = number;
    @Entity
    public class EntityB implements java.io.Serializable {
         @Id
         @GeneratedValue
         private long     id;
         @Column(name = "NUMBER", unique = true)
         private int          number;
         public EntityB() {}
         public EntityB(int number) {
              this.number = number;
    }I found two related topics in this forum but still I didn't find the solution yet.
    [Enterprise JavaBeans - CMT and JDBC|http://forums.sun.com/thread.jspa?forumID=13&threadID=525651]
    and
    [ Forums - A CMT Session Bean Does Not Maintain the Transaction Correctly| http://forums.sun.com/thread.jspa?forumID=13&threadID=161512]
    Maybe anyone can give me a hint. Help is very much appreciated
    Christoph

    Thank you for your input!
    The save() method is simply invoked from the test applications main() method:
    public class Test {
         public static void main(String[] args) {
              JndiUtil<ManageEntity> jndiUtil = new JndiUtil<ManageEntity>();
              ManageEntity handler = jndiUtil.lookupBeanContext("ManageEntityBean", ManageEntity.class);
              handler.save();
    }Btw. I use Hibernate as persistence provider and JBoss 4.2.2.GA as application server.
    For clarity I attach some lines of the debug logging that is produced when the test application is getting started for the second time:
    ### open Session
    17:44:00,555 DEBUG *[SessionImpl] opened session at timestamp: 5007498610909184*
    17:44:00,555 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
    17:44:00,555 DEBUG [JDBCContext] successfully registered Synchronization
    17:44:00,555 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
    17:44:00,555 DEBUG [AbstractEntityManagerImpl] Transaction already joined
    ### invoke em.persist(aEntity)
    17:44:00,555 DEBUG [AbstractSaveEventListener] executing identity-insert immediately
    17:44:00,555 DEBUG [AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    17:44:00,555 DEBUG *[ConnectionManager] opening JDBC connection*
    17:44:00,555 DEBUG [SQL]
    /* insert de.zippus.domain.EntityA
    17:44:00,556 INFO [STDOUT] Hibernate:
    /* insert de.zippus.domain.EntityA
    17:44:00,558 DEBUG [IdentifierGeneratorFactory] Natively generated identity: 2
    17:44:00,559 DEBUG [AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    17:44:00,559 DEBUG [ConnectionManager] aggressively releasing JDBC connection
    17:44:00,559 DEBUG [ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: >0)]
    ### invoke em.persist(bEntity)
    17:44:00,559 DEBUG [AbstractSaveEventListener] executing identity-insert immediately
    17:44:00,559 DEBUG [AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    17:44:00,559 DEBUG [ConnectionManager] opening JDBC connection
    17:44:00,559 DEBUG [SQL]
    /* insert de.zippus.domain.EntityB
    17:44:00,560 INFO [STDOUT] Hibernate:
    /* insert de.zippus.domain.EntityB
    17:44:00,561 DEBUG [AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    17:44:00,561 DEBUG [ConnectionManager] aggressively releasing JDBC connection
    17:44:00,561 DEBUG [ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: >0)]
    17:44:00,561 DEBUG [JDBCExceptionReporter] could not insert: [de.zippus.domain.EntityB] [* insert de.zippus.domain.EntityB */ insert into >ENTITY_B (NUMBER) values (?)]
    com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '10' for key 2
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
    17:44:00,563 WARN [JDBCExceptionReporter] SQL Error: 1062, SQLState: 23000
    17:44:00,563 ERROR [JDBCExceptionReporter] Duplicate entry '10' for key 2
    17:44:00,563 DEBUG [AbstractEntityManagerImpl] mark transaction for rollback
    17:44:00,563 ERROR [ManageEntityBean] Caught exception: javax.persistence.EntityExistsException: >org.hibernate.exception.ConstraintViolationException: could not insert: [de.zippus.domain.EntityB]
    17:44:00,563 ERROR [ManageEntityBean] Exception Cause: org.hibernate.exception.ConstraintViolationException: could not insert: >[de.zippus.domain.EntityB]
    17:44:00,564 DEBUG *[ManagedEntityManagerFactory] ************** closing entity managersession *************** Up to now I'm not that experienced in reading and understanding this kind of logging, but what I can see is, that there is a transaction that spans the whole unit of work and that this transaction is marked for rollback. I think that's quite a good thing, isn't it?
    But what really puzzles me here is, that both calls of em.persist() result in an opening of a jdbc connection and an immidiate execution of a database insert. Tell me if I'm wrong, but is this really the right place to happen?
    For what reason soever hibernate thinks it has to make these instances permanent, no matter if there is already a session that is taking care of this. If so, I might deal with a wrong hibernate configuration, I checked, but I can't find anything..
    What do you think?
    Thanks in advance!
    Christoph

  • Problem with DataLoader and Oracle 8.1.6

    I am currently running WebLogic Commerce Server under the following
    configuration.
    1. Solaris 8
    2. WebLogic Server 5.1
    3. WebLogic Commerce Server 2.0.1
    4. Oracle 8.1.6
    5. JDK 1.2.2
    I have followed the instructions completely as it relates to running
    with Oracle. Everything works fine up to the point in which I run the
    DataLoader.sh script.
    The DataLoader.sh script almost completes. However, after some time is
    spend loading items, I see the following WebLogic dumb, and the
    DataLoader.sh scripts quits.
    Some other points. I am using the Oracle thin driver (Classes111.zip).
    The size and date of the classes111.zip are as follows.
    Date: 12/14/1999
    Size: 1.4Meg
    Any ideas as to what the problem is.
    Tue Aug 15 18:27:07 EDT 2000:<I> <ListenThread> Adding address:
    localhost/127.0.0.1 to licensed client list
    Tue Aug 15 18:27:08 EDT 2000:<I> <ServletContext-General> classes: init
    Tue Aug 15 18:27:15 EDT 2000:<I> <ListenThread> Adding address:
    webdev1.grhq.gfs.com/1.1.8.146 to licensed client list
    Tue Aug 15 18:27:15 EDT 2000:<D> <JVMSocketHTTPServer> opened sockID:
    '0'
    Tue Aug 15 18:29:30 EDT 2000:<I> <CliCon-#|server|0.966378014892>
    Removing ClientContext - id: '#|server|0.966378014892', bound: 'false',
    dead: 'false' because of soft disconnect timeout
    Tue Aug 15 18:29:30 EDT 2000:<D> <JVMSocketHTTPServer> Closing JVM
    socket: 'weblogic.socket.JVMSocketHTTPServer@5b43a9 - id: '0', closed:
    'true', lastRecv: '966378570911''
    java.lang.Throwable: Stack trace
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at
    weblogic.socket.JVMSocketHTTPServer.close(JVMSocketHTTPServer.java:433)
    at weblogic.socket.JVMAbbrevSocket.close(JVMAbbrevSocket.java:383)
    at weblogic.rjvm.ConnectionManager.shutdown(Compiled Code)
    at weblogic.rjvm.ConnectionManagerServer.shutdown(Compiled Code)
    at weblogic.rjvm.RJVMImpl.peerGone(Compiled Code)
    at weblogic.rjvm.RJVMImpl.gotExceptionReceiving(RJVMImpl.java:523)
    at
    weblogic.rjvm.ConnectionManager.gotExceptionReceiving(ConnectionManager.java:720)
    at
    weblogic.socket.JVMAbbrevSocket.gotExceptionReceiving(JVMAbbrevSocket.java:397)
    at weblogic.socket.JVMSocketT3.endOfStream(JVMSocketT3.java:549)
    at weblogic.socket.JavaSocketMuxer.processSockets(Compiled Code)
    at
    weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
    at weblogic.kernel.ExecuteThread.run(Compiled Code)
    Tue Aug 15 18:29:31 EDT 2000:<D> <HTTPTunneling> Sending DEAD response
    on socket: 'weblogic.socket.MuxableSocketHTTP@db93a - idle timeout:
    '60', socket timeout: '100''
    java.lang.Throwable: Stack trace
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at
    weblogic.socket.TunnelServlet.sendDeadResponse(TunnelServlet.java:60)
    at
    weblogic.socket.JVMSocketHTTPServer.close(JVMSocketHTTPServer.java:438)
    at weblogic.socket.JVMAbbrevSocket.close(JVMAbbrevSocket.java:383)
    at weblogic.rjvm.ConnectionManager.shutdown(Compiled Code)
    at weblogic.rjvm.ConnectionManagerServer.shutdown(Compiled Code)
    at weblogic.rjvm.RJVMImpl.peerGone(Compiled Code)
    at weblogic.rjvm.RJVMImpl.gotExceptionReceiving(RJVMImpl.java:523)
    at
    weblogic.rjvm.ConnectionManager.gotExceptionReceiving(ConnectionManager.java:720)
    at
    weblogic.socket.JVMAbbrevSocket.gotExceptionReceiving(JVMAbbrevSocket.java:397)
    at weblogic.socket.JVMSocketT3.endOfStream(JVMSocketT3.java:549)
    at weblogic.socket.JavaSocketMuxer.processSockets(Compiled Code)
    at
    weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
    at weblogic.kernel.ExecuteThread.run(Compiled Code)

    Javier, these are database parameters picked p from the init.ora of that database. To check the values of these parameters, logon to the database via SVRMGRL as the DBA and then execute the command :
    SVRMGR>SHOW PARAM
    This lists all the database paramaters. Also check if the Oracle MTS Service is actually running.

Maybe you are looking for