Oracle Issue around handling CLOB within Workflow Transaction

Hi,
- In Workflow Notification Message I am using an CLOB Document for building the
message Body
- This CLOB value is going to be SELECTed and initialized from a TABLE
(having CLOB column) during the document related procedure execution
NOTE: In order to select from a CLOB we need to issue FOR UPDATE
to have read consistency
(otherwise it will give LOB not locked for update error during notification display)
Here the issue I am facing is :
The same notification is going to be sent to Multiple users (thru Notification
to a Apps.Responsibility i.e. WF Role)
When USER1 opens the notification, the CLOB Table row gets a lock
(due to FOR UPDATE) and is not released until ROLLBACK/COMMIT
which will not happen as it is a workflow (if I put this Select FOR UPDATE
in a AUTONOMOUS transaction then it gives error as LOCATOR id cannot
spawn between transactions during the notification display)
When USER2/USER3 opens the same notification which he received being a member
of the Responsibility , the notificaiton screen gets hanged as it again
tries to issue SELECT FOR UPDATE and sees USER1 holds the lock.
My Requirement is:
When first time anyone user opens the notification, it will not find a record in table
so it builds the notification and stores the CLOB record into the table.
Next time onwards all the users should get the stored record from the table
(Read CLOB value from Table and show in the Notification Message Body)
Please help me in resolving the SELECT FOR UPDATE of a CLOB within Workflow
when multiple users need to issue without the need of a COMMIT/ROLLBACK
NOTE: Even I am only Reading the CLOB value from a Table, without
having any need of updating it, still I need to Issue FOR UPDATE
as per Oracle CLOB constraint.
thanks,
Shashi

Hi,
I didn't do the select directly into document when I did it in my test. Here's the two different methods that I used in my database to test the problem:
create or replace procedure msclobtest
                   (document_id   IN     VARCHAR2
                   ,display_type  IN     VARCHAR2
                   ,document      OUT    CLOB
                   ,document_type OUT    VARCHAR2
                   ) as
cursor c1 is select theclob from ms3 where clob_id = 4;
v_clob clob;
begin
debug('started clob');
open  c1;
fetch c1 into v_clob;
close c1;
document := v_clob;
document_type := 'text/html';
debug('clob ended');
end;
create or replace procedure msclobtest
                   (document_id   IN     VARCHAR2
                   ,display_type  IN     VARCHAR2
                   ,document      OUT    CLOB
                   ,document_type OUT    VARCHAR2
                   ) as
cursor c1 is select theclob from ms3 where clob_id = 4;
v_clob clob;
begin
open  c1;
fetch c1 into v_clob;
close c1;
dbms_lob.createtemporary(document,FALSE);
dbms_lob.copy(document,v_clob,dbms_lob.getlength(v_clob));
document_type := 'text/html';
end;If it's not the code, then it might be something in the Workflow itself.
Are the values of the document attribute being set correctly in the Workflow? Are you sending to a role? Have you checked the "Expand Roles" tick box? Have you checked the "Attach Content" tick box?
Matt
Alpha review chapters from my book "Developing With Oracle Workflow" are available on my website:
http://www.workflowfaq.com
http://forum.workflowfaq.com

Similar Messages

  • Bug in Oracle Driver 11.2.0.3.0 when handling CLOB?

    Hello,
    I got a table which is defined like this:
    CREATE TABLE FOO
    FOO_id NUMBER(18) NOT NULL ,
    xml_content sys.XMLTYPE NOT NULL
    According to the documentation Oracle is using a CLOB as internal type.
    For reading the CLOB from the database we are using Spring's org.springframework.jdbc.support.lob.OracleLobHandler (Spring 3.0.6.RELEASE) class which is implemented like this:
    public String getClobAsString( ResultSet rs, int columnIndex ) throws SQLException
    logger.debug( "Returning Oracle CLOB as string" );
    Clob clob = rs.getClob( columnIndex );
    initializeResourcesBeforeRead( rs.getStatement().getConnection(), clob );
    String retVal = ( clob != null ? clob.getSubString( 1, (int) clob.length() ) : null );
    releaseResourcesAfterRead( rs.getStatement().getConnection(), clob );
    return retVal;
    For me, this looks like the valid solution. But when reading CLOB greater than 4109 bytes, the resulting String contains a 0x0 (NULL) byte. Because the table is defined to contain XML, the XML parser is unable to handle this.
    As workaround I got the following solution:
    public String getClobAsString( ResultSet rs, int columnIndex ) throws SQLException
    logger.debug( "Returning Oracle CLOB as string" );
    Clob clob = rs.getClob( columnIndex );
    initializeResourcesBeforeRead( rs.getStatement().getConnection(), clob );
    readAllCharacter( clob );
    String retVal = ( clob != null ? clob.getSubString( 1, (int) clob.length() ) : null );
    releaseResourcesAfterRead( rs.getStatement().getConnection(), clob );
    return retVal;
    * Dummy read of all characters of the given lob. This fixes an issue that the resulting string
    * contains 0x0 bytes.
    * @param clob the clob
    * @throws SQLException
    private void readAllCharacter( Clob clob ) throws SQLException
    if( clob != null )
    Reader characterStream = clob.getCharacterStream();
    char[] buffer = new char[4 * 1000];
    try
    while( characterStream.read( buffer ) != -1 )
    catch( IOException e )
    logger.error( "Exception while reading from the clob", e );
    finally
    try
    characterStream.close();
    catch( IOException e )
    // nothing to do;
    With this dummy read, the string does not contain the 0x0 token.
    I think it's a Bug in the oracle.sql.CLOB class or did I miss something?
    Kind regards
    Michael

    >
    I'm unsure what you mean with your citation and how this affects my code?
    >
    That citation specifically tells you how the drivers (based on version) support 'the Oracle SQL XML type (XMLType)'.
    >
    A call to getSubString should give me the content of the clob. But why does the content contain some bytes (0x0) which should not be there.
    >
    A CLOB instance is just a LOB locator. A locator contains the information necessary for Oracle to 'locate' the full lob contents. It usually also contains all of the lob data that is stored 'inline' in the table row. There is a limit of around 4k for the 'inline' part of the lob data.
    A lob locator does NOT contain the part of the lob that is stored in the lob segment. The 'out-of-line' lob is generally retrieved using streams as shown in that doc.
    So the 'getSubString' call is only using the contents of the locator.
    See Inline and Out-of_Line LOB Storage in the 'Oracle® Database SecureFiles and Large Objects Developer's Guide'
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28393/adlob_tables.htm
    >
    Inline and Out-of-Line LOB Storage
    LOB columns store locators that reference the location of the actual LOB value. Depending on the column properties you specify when you create the table, and depending the size of the LOB, actual LOB values are stored either in the table row (inline) or outside of the table row (out-of-line).
    LOB values are stored out-of-line when any of the following situations apply:
    If you explicitly specify DISABLE STORAGE IN ROW for the LOB storage clause when you create the table.
    If the size of the LOB is greater than approximately 4000 bytes (4000 minus system control information), regardless of the LOB storage properties for the column.
    If you update a LOB that is stored out-of-line and the resulting LOB is less than approximately 4000 bytes, it is still stored out-of-line.
    LOB values are stored inline when any of the following conditions apply:
    When the size of the LOB stored in the given row is small, approximately 4000 bytes or less, and you either explicitly specify ENABLE STORAGE IN ROW or the LOB storage clause when you create the table, or when you do not specify this parameter (which is the default).
    When the LOB value is NULL (regardless of the LOB storage properties for the column).
    Using the default LOB storage properties (inline storage) can allow for better database performance; it avoids the overhead of creating and managing out-of-line storage for smaller LOB values. If LOB values stored in your database are frequently small in size, then using inline storage is recommended.
    Note:
    LOB locators are always stored in the row.
    A LOB locator always exists for any LOB instance regardless of the LOB storage properties or LOB value - NULL, empty, or otherwise.
    If the LOB is created with DISABLE STORAGE IN ROW properties and the BASICFILE LOB holds any data, then a minimum of one CHUNK of out-of-line storage space is used; even when the size of the LOB is less than the CHUNK size.
    If a LOB column is initialized with EMPTY_CLOB() or EMPTY_BLOB(), then no LOB value exists, not even NULL. The row holds a LOB locator only. No additional LOB storage is used.
    LOB storage properties do not affect BFILE columns. BFILE data is always stored in operating system files outside the database.
    >
    You should generally use streams to read/write LOBs as they are the most efficient way to access them. If you commonly only need a subset of the data I suggest you use a PL/SQL package/function/procedure to perform the substringing and return the results.
    >
    the first read results also in an String with the 0x0 byte
    >
    And those would be part of the lob locator.

  • Oracle.xml.sql.OracleXMLSQLException:Cannot enable auto commit within JTS transaction

    Hi All,
    OracleXMLSave class in the Oracle XDK is being used to load XML data into an 8170 database. The Java code is running in IBM WebSphere with container-managed transactions. When JTA is enabled with the Merant JDBC driver for Oracle, we get the following error when the XML is loaded:
    oracle.xml.sql.OracleXMLSQLException: Cannot enable auto commit within JTS
    transaction
         at java.lang.Throwable.fillInStackTrace(Native Method)
         at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:2213)
         at oracle.xml.sql.dml.OracleXMLSave.insertXML(Compiled Code)
    This suggests the OracleXMLSave class is not aware of the fact that it is now operating in a JTS transaction where control is managed elsewhere. i.e. should also not attempt to commit or rollback, as this is the responsibility of the container.
    Is there a property which needs to set to prevent the above or does the XDK not work with J2EE (JTS) transactions?.
    If you have any useful comments, let me know. Testing the above presents me with a number of problems so if this is easily explained , let me know.
    Thanks,
    Malcolm

    Clearly , there does seem to be something a bit odd with the above stack.
    <Bug:1917808> mentions OracleXMLSave in context of plsql equivalent : dbms_xmlsave . i.e dbms_xmlsave is a wrapper around OracleXMLSave class.
    disabling autocommit on connection as follows should help:
    conn = DriverManager.getConnection("connect string","scott","tiger");
    conn.setAutoCommit(false);
    to disble auto commit and see if this has an effect.
    This issue might be <Bug:1497506>. If disabling autocommit does not work then it appears that it could be this issue .
    Malcolm
    Hi All,
    OracleXMLSave class in the Oracle XDK is being used to load XML data into an 8170 database. The Java code is running in IBM WebSphere with container-managed transactions. When JTA is enabled with the Merant JDBC driver for Oracle, we get the following error when the XML is loaded:
    oracle.xml.sql.OracleXMLSQLException: Cannot enable auto commit within JTS
    transaction
         at java.lang.Throwable.fillInStackTrace(Native Method)
         at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:2213)
         at oracle.xml.sql.dml.OracleXMLSave.insertXML(Compiled Code)
    This suggests the OracleXMLSave class is not aware of the fact that it is now operating in a JTS transaction where control is managed elsewhere. i.e. should also not attempt to commit or rollback, as this is the responsibility of the container.
    Is there a property which needs to set to prevent the above or does the XDK not work with J2EE (JTS) transactions?.
    If you have any useful comments, let me know. Testing the above presents me with a number of problems so if this is easily explained , let me know.
    Thanks,
    Malcolm

  • ORACLE PM - cannot handle attribute href - SOAP style encoded

    Hello !
    The problem is, can ORACLE Process Manager handle href attributes.
    I call a webservice with a BPEL-Process, the webservice replys a message, but the Process Manager cannot handle the message from the webservice.
    This is the reply message from the webservice, there are many href attributes inside:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <taskFinished soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <taskId href="#id0"/>
    <context href="#id1"/>
    </taskFinished>
    <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns1:TaskId" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://itsas.de/leasit/workflow/angebot">
    <id href="#id2"/>
    </multiRef>
    <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:ProcessContext" xmlns:ns2="http://itsas.de/leasit/workflow/angebot" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <map href="#id3"/>
    </multiRef>
    <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1181728963963</multiRef>
    <multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:Map" xmlns:ns3="http://itsas.de/leasit/workflow/angebot" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item href="#id4"/>
    <item href="#id5"/>
    </multiRef>
    <multiRef id="id5" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:MapItem" xmlns:ns4="http://itsas.de/leasit/workflow/angebot" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <key xsi:type="xsd:string">angebotId</key>
    <value xsi:type="xsd:string">LA-0000-0102</value>
    </multiRef>
    <multiRef id="id4" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:MapItem" xmlns:ns5="http://itsas.de/leasit/workflow/angebot" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <key xsi:type="xsd:string">kundeId</key>
    <value xsi:type="xsd:string">C00002</value>
    </multiRef>
    </soapenv:Body>
    </soapenv:Envelope>
    I think the SOAP documentstyle from the webservices use rpc style and encoded, that is why the axis is change the normal XML structure to the structure above with links.
    But I think the ORACLE Process Manager can only handle SOAP style="document" and use="literal" ???????
    The fault message from ORACLE is:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <faultcode>env:Server</faultcode>
    <faultstring>java.lang.NullPointerException</faultstring>
    <faultactor></faultactor>
    </env:Fault>
    </env:Body></env:Envelope>
    Can anybody help me, please. Is ORACLE Process Manager able to unterstand SOAP style encoded ?!!!

    I have a bug logged against this issue, bug # is 5990259. However, the service I was calling is no longer available, so development can't reproduce it... If you gave them your example as well maybe they could progress this bug? Anyway BPEL does work with RPC/Encoded, it just doesn't like those multi refs. The company we were interacting with was using WebObjects, which was behaving exactly as in your example, and they changed an option on the web service to get rid of the multi refs and it worked (was still RPC/Encoded).

  • How to handle CLOB

    Hello,
    In my java programme I am picking a huge data from a file and passing it to a oracle stored procedure.
    In my oracle stored procedure I pick data line by line and process and to identify a new line I use CHR(10).
    The problem is, the file containing the data has data in lines but when the data is read and sent over to oracle called procedure the new line is missing and the complete data is found in one line which is very huge. Hence the processing of data fails.
    In Java programme, How should I read the data from the file so that the new line or line terminator remains as it is. Or the data is read exactly as it is in the file.
    Also, the Oracle stored procedure argument is of CLOB type. How to handle CLOB in JAVA, that is, pass more than 32767 chars.
    Thanks & Regards,
    Sanju.

    Your problem is that createClob() isn't implemented until JDBC 4 (which I think will come with mustang). The usual way people deal with new Clob records on Oracle is to create the record, initially, with an empty Clob, read the record back and use getClob to get the Clob, then write to that and update the record. (Pretty aweful)
    A technique I've found works on Postgressql blobs and which is probably worth a try is to write your own, minimal implentation of Clob. All it needs to handle are the length() and getCharacterStream methods (all others throw UnsupportedOperationException or similar. Try feeding one of those through a setClob(). Might work, might not.
    With any luck JDBC will read your stream into the LOB as part of the setClob() action.

  • How can we handle CLOB in Universe and WebIntelligence

    Hi,
    Could  you explain how can we handle CLOB in Universe and WebIntelligence?If we use CLOB in either of this,how is the  Report performance ?Is the perfomance of report degraded? Appreciate your help.
    Thanks,
    Swapna

    Hi,
    There is no way around this, long texts are big chunks of data that have to be moved from the database to the webi report.
    Depending on how many rows of data you retrieve this can become a problem in various spots.
    1) network traffic (lots of data to move over the network).
    2) webi report memory (lots of data that needs to be stored in memory to work with the data).
    So you need to limit the query in either the number of rows being retrieved,
    or in the size of the data that is retrieved per row.
    Depending on your use of message text, you can limit long text object to a smaller number of characters.
    (Universe, Parameters, Controls...)
    Depending on your version of database and BO, the default of this value is 1000 or unrestricted.
    It might be that you just need an idea of the message and can limit this to 100 chars or similar, which should help performance.
    It is also possible that the text is always 'long' padded with spaces, in this case it can help to trim the message column in the universe already.
    Good luck,
    Marianne

  • Setup single instance of  Oracle B2B to handle both HTTP as well as HTTPS r

    Hi,
    I want to send 850 transaction to different trading partner who are using HTTP and HTTPS.I want to create a single instance of ORACLE B2b to handle both HTTP and HTTPS. Please do the needful.
    Thanks and Regards
    Srinivas kola
    Edited by: user11342588 on Jul 15, 2009 3:15 AM

    Hi Anuj,
    Thanks for your response.But i want to do for both inbound and outbound, Given below is an example
    OUTBOUND:
    Host Trading Partner ------------------------------- Internet----------------encrypt message------------------>--trading partner1
    Port no 50
    ------------------------------ Internet----------------encrypt message-------------------->trading partner2
    ------------------------------Internet----------------encrypt message-------------------->trading partner3
    INBOUND:
    Host Trading Partner ------------------------------- Internet----------------encrypt message-<-------------------trading partner1
    Port no 50
    ------------------------------ Internet----------------encrypt message-<-------------------trading partner2
    I want to use only a single instance of Oracle B2B to handle both HTTP and HTTPS
    Help me please

  • ORA-00164: autonomous transaction disallowed within distributed transaction

    I have been trying to solve this problem for weeks now, I have posted this question everywhere I can think of, but I havent really received and answer that has helped, so now I am going to post it here hoping for an answer.
    We are running 9iAS on Solaris and when the following stuff is run we are getting ORA-00164 errors. If you refresh the page a bunch of time the problem goes away. But it comes back the next time you try to execute the procedure again. Here are the cases when the problem shows up.
    Editing the style:
    PROCEDURE : PORTAL30.wwpob_app_style.edit_style
    Saving changes to the banner for a page
    PROCEDURE : PORTAL30.wwptl_banner.savecustom
    Logging out
    PROCEDURE : PORTAL30.wwsec_app_priv.logout
    After setting the default user group and applying the changes:
    PROCEDURE : PORTAL30.wwsec_app_user_mgr.edit_user
    Creating a new group:
    PROCEDURE : PORTAL30.wwsec_app_group_mgr.create_group
    Opening the add portlet screen:
    PROCEDURE : PORTAL30.wwv_main.main
    There are a few other places but I don't have them documented. In ALL cases the problem goes away once we start and stop the Apache using the following comands:
    /app/oracle/n_portal/Apache/Apache/bin/apachectl stop
    ps -ef | grep httpd | grep n_portal
    /app/oracle/n_portal/Apache/Apache/bin/apachectl start
    After starting and stopping Apache the problem is gone for a little while (20-30 mins) then it starts coming back slowly (sometimes the problem is there then it is not). Once the problem is back if you continually press refresh on the browser (5-10 times) the page might appear, if the page does not appear you will see the
    ORA-00164: autonomous transaction disallowed within distributed transaction
    The following error appears in apache log (50% of the time) when Autonomous Transaction error shows up on the screen:-
    DSHttpSessionBindingListenerImpl.valueUnbound : closing DS session : DSSession id = 5225534324468880950975536484
    215 PortalSession id = 521335001720MERAJ
    DSHttpSessionBindingListenerImpl.valueUnbound : closing DS session : DSSession id = -638034231325135430097553725
    8001 PortalSession id = 992335001711JDALGLIESH
    These errors might be related to dynamic services but we were had the problem long before Dynamic services was installed.
    We want to start pre-production user testing as we have just had 11 developers building portlets for the company, but we cant do much with this error popping up every time a user wants to test it. We have one of the Oracle consultants here and he has asked the oracle developer group what the problem could be, and they seem to think it might be related to our use of DB links however, we never get the problem when we try to run a portlet that uses a database link.
    Please help.
    Jeff Dalgliesh
    null

    Jay,
    My name is Craig McCauley. I'm an Oracle Technical Manager working onsite at Unocal Indonesia. I'm with the Portal group in ATS.
    When I got here the first thing we did was bump up init.ora parameters and apache confif parameters as suggested by the iPlatform group. We have thes sessions parameter (in init.ora) bumped up from 100 to 700. I'm watching v$session and the get these AT messages with as few as 70 total db sessions. Any help your group can give will be greatly appreciated.
    Unocal is planning on implementing Oracle Portal globally - as a common interface. They have similar installs in Thailand and Houston and thus far have not seen the AT messages (although there has not been much development going on at those sites).
    Thanks,
    Craig

  • Best practise around handling time dependency for flat file loads

    Hi folks,
    This is a fairly common situation - handling time dependency for flat file loads. Please can anyone share their experience around handling this. One common approach is to handle the time validity changes within the flat file where it is easily changeable by the user but then again is prone to input errors by the user. Another would be to handle this via a DSO. Possibly, also have this data entered directly in BI using IP planning layouts. There is a IP planning function that allows for loading flat file data but then again, it only works without the time dependency factor.
    It would be great to hear thoughts or if anyone can point to a best practise document for such a scenario.
    Thanks.

    Bump!

  • Differences in Oracle Service Bus, BPEL and human workflow

    Hi Everyone,
    I am newbie, don't know if its the right place to post this thread.
    I want to prepare paper on differences in Oracle Service Bus, BPEL and human workflow, can anybody help me.
    Till now i came to know all these things are very different, no poit comparing them but still need differences
    Thanks in advance:
    Vikas

    Basic difference:
    BPEL : It is used for orchastrating different processes. Its heavyweight and stores instances (stateful)
    OSB : It is used for routing data between the applications
    Human Workflow : It is used to handle scenarios where manual intervention is necessary.
    Refer for more on Oracle BPEL
    http://www.oracle.com/technology/products/ias/bpel/htdocs/orabpel_faq.html
    Regards,
    Ketan

  • DB_APPEND on a queue within a transaction

    Hello,
    With your help, I did get my test program worked. It appends data on a queue.
    But now I have problems to do the same thing but within a transaction. I get an "Invalid argument" error.
    Thanks for a little help.
    Here is my small test program :
    #include <stdio.h>
    #include <string.h>
    #include <ctype.h>
    #include <fcntl.h>
    #include <errno.h>
    #include <db.h>
    DB_ENV *env;
    int ret;
    DB * db;
    const int QUEUE_RECORD_SIZE = 50;
    int pad_char = 35; // #
    char * dbName = "queue-test-file.db";
    u_int32_t db_flags;
    u_int32_t env_flags =
    DB_CREATE | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG |
    DB_INIT_MPOOL | DB_THREAD | DB_RECOVER | DB_REGISTER;
    db_recno_t recno;
    DBT key, data;
    char buf[1024];
    u_int32_t len;
    typedef enum { FALSE = (0 == 1), TRUE = (1 == 1)} Boolean;
    Boolean FirstTime = TRUE;
    int main(void) {
    DB_TXN *l_txn = NULL;
    int i = 0;
    ret = db_env_create (&env, 0);
    if (ret != 0) {
    printf("error in db_env_create\n");
    ret = env->open (env, "/data/test/", env_flags, 0);
    if (ret != 0) {
    printf("error in env open\n");
    ret = db_create (&db, env, 0);
    if (ret != 0) {
    printf("error in db_create\n");
    ret = db->set_re_len(db, QUEUE_RECORD_SIZE);
    if (ret != 0) {
    printf ("error in set_re_len\n");
    ret = db->set_re_pad(db, pad_char);
    if (ret != 0) {
    printf("error in set_re_pad\n");
    db_flags = DB_CREATE;
    ret = db->open (db, NULL, dbName, NULL, DB_QUEUE, db_flags, 0);
    if (ret != 0) {
    printf ("database opening failed (%s) Error = %s\n", dbName, db_strerror (ret));
    memset (&key, 0, sizeof (DBT));
    memset (&data, 0, sizeof (DBT));
    // writing
    while (TRUE) {
    printf("record #%lu> ", (u_long)recno); fflush(stdout);
    fgets(buf, sizeof(buf), stdin);
    if(!strncmp(buf, "quit", 4)) {
    if (i > 0) ret = l_txn->commit (l_txn, 0);
    break;
    if ((len = strlen(buf)) <= 1) continue;
    key.data = &recno;
    key.flags = DB_DBT_USERMEM;
    key.ulen = sizeof(recno); // for the check out
    data.data = buf;
    data.size = len - 1;
    if (FirstTime) ret = env->txn_begin (env, NULL, &l_txn, 0);
    if (i == 2) {
    ret = l_txn->commit (l_txn, 0);
    ret = env->txn_begin (env, NULL, &l_txn, 0);
    i = 0;
    FirstTime = FALSE;
    switch (ret = db->put(db, NULL, &key, &data, DB_APPEND)) {
    case 0: printf("OK\n");
    ++i;
    break;
    default: db->err(db, ret, "DB->put"); break;
    db->close (db, 0);
    if (ret != 0) {
    printf ("database close failed (%s) Error = %s\n", dbName, db_strerror (ret));
    ret = env->close (env, 0);
    if (ret != 0) {
    printf ("database close failed (%s) Error = %s\n", dbName, db_strerror (ret));
    return(0);
    } // end of main

    To perform transactional operations on a Berkeley DB database, the DB->open call must be done in a transaction. The simplest way to do this is to change:
    db_flags = DB_CREATE;to:
    db_flags = DB_CREATE | DB_AUTO_COMMIT;Regards,
    Michael Cahill, Oracle Berkeley DB.

  • Doubt handling Clob columns with Java JDBC api

    Hi,
    we have a doubt handling Clob columns with Java JDBC api.
    Reading Oracle 10g official documentation (document b10979.pdf, page 236), we found this note:
    ============================================
    To write LOB data, the application must acquire a write lock on the LOB object. One way to accomplish this is through a SELECT FOR UPDATE. Also, disable auto-commit mode.
    ============================================
    We also found a java sample code about how to handle Lob objects at this URL:
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.java.html
    In our java2 application, we access Clob objects in a quite different
    manner: we use normal setString() and getString() methods, as described into paragraph "Shortcuts For Inserting and Retrieving CLOB Data"
    (document b10979.pdf, page 244).
    Using those methods, we never lock the table row by a SELECT FOR UPDATE statement (as described into the note above). We use simply SELECT, UPDATE and INSERT prepared statement.
    In this way we can insert both clob objects and normal timestamp, number and other types with a single insert statement. Idem for update.
    To recap, our question is:
    Is it mandatory to create a SELECT FOR UPDATE statement when updating clob data? What may be the consequences if we don't use it? It is also correct to insert with a single sql statement both clob and not clob data using the setString() method for the clob types? And more than one lob column in the same record?
    bye,
    luca acri.

    And columns of type FLOAT. These also have, for some unknown reason a metadata type of OTHER, and a type string of 'FLOAT'. Yet PreparedStatement.setNull(x, Types.OTHER) doesn't work and setNull(x, Types.DECIMAL) does.

  • Can Bi Publisher handle CLOB values?

    Hello,
    I've a requirement to generate a letter/report from BI Publisher(Standalone version) in which the Data Template includes a sql query to extract data from table which has clob value? Can Bi Publisher handle clob values? Please guide.
    Thanks.

    Can anyone please advise me if i can create a Data template with SQL query to extract the clob data from a table? and generate a report in pdf format? Am not sure if BI Publisher handles CLOB values?
    My version is Oracle BI Publisher 10.1.3.4.0 (stand alone).
    Please guide.
    Thanks.

  • Issuing a handling unit to production order

    Hi
    Is it possible to issue a handling unit to production order. Kindly through some tips in this regard.
    Thanks and Regards
    Saravana Kumar

    hi Sarvana,
    a handling unit consists of altogether several contents items that are listed as
    >full delivery items,
    >partial delivery items,
    >or even further handling units
    So from the above the handling unit consist of the items for delivery and are packed in one packaging
    material (box). The packaging material and the materials it contains form a handling unit that is
    assigned to a delivery and can be moved within the warehouse. The content of the handling unit is not significant for Warehouse Management. In fact, the contents can only be determined by referring to the delivery.
    So a HU can't be assigned to the production order within the same plant.
    for further assistance you can check the following link.
    http://help.sap.com/saphelp_47x200/helpdata/en/16/4bad1ba63611d2b44e006094b9b9dd/frameset.htm.
    hope this helps to answer your question,
    with regards,

  • Not getting email notifications in Oracle AIA Exception handling

    We are using Oracle AIA Exception Handling feature. In the BPEL process , we have catch branches defined. From the catch brances we are invoking AIAAsyncErrorHandlerBPELProcess.
    In case of an exception , the instance of AIAAsyncErrorHandlerBPELProcess and AIAReadJMSNotification is being created. We have configured ns_emails.xml and user_properties.xml as per the documentation.
    We are not receiving any emails.
    I have tried a BPEL process with email activity. Email was sent from this process.
    Kindly let us know the issue.

    Please ensure you are following all 4 steps mentioned in this blog article, http://blogs.oracle.com/aia/2009/09/aia_error_notifications.html.
    If the issue still persists, please look for an error message in opmn log file and post it here.
    Regards
    Rohit

Maybe you are looking for

  • How to delay creation of VideoDisplay

    My Flex' app reads an xml with different video-source-url's. On the same time the VideoDisplay is created. But it does not have the url for the VideoDisplay source property because parsing is taking to long. How can I delay the creation of the VideoD

  • Mac crashed..can't sync..help!

    my macbook crashed and i lost everything and now i can't sync my phone.  I authorized the computer, and transfered the purchases.   All my apps show up on the screen now, however they're not highlighted..i can't move or select or sync anything from m

  • Returning SAP standard error

    Hello, I have created an RFC to replicate the functionality of VLMOVE (movement type 313) for creating a delivery.For this I have used some standard performs and I able to create the delivery by passing the required inputs(plant,storage location,HU).

  • App Server performance monitoring

    Hi Does anyone know a good J2EE performance monitoring tool for Sun ONE AppServer 7 ??? I have found a few, but most of them support Weblogic, Websphere and they leave Sun ONE in the "others". I want to know if there's a tool made specially for Sun O

  • System exec in LV 5.0

    I'm trying to run a MSDOS based program in labview. Will I have to move to a certain directory where the executable is located? For example, to open labview.exe. I created a sequence which first inputs "cd\labview\" into system exec and then in anoth