BC4J, Triggers, and Clobs

I'm on a J2EE web-application that is using the BC4J framework. At one point, we're taking some information from a form and saving that info into a table (composed of a couple varchar columns and a couple of CLOB columns). There are two triggers associated with this table, one that fires before insert that grabs a seq number as well as a date, and another that fires after insert that calls a PL/SQL procedure that creates a txt file on our filesystem with the appropriate info. The text file, however, does not contain the information from the CLOB fields. When inserting a new record from SQL*PLUS, the text file is created correctly, meaning the triggers work fine, the insert works fine, the writing to the file system works fine. So, what's the difference between inserting from SQL*PLUS and inserting through the web application?
To test a theory, I removed the trigger and put the call to the PL/SQL procedure into a callablestatement in one of the actions. This actually led to a correct writing to the file system. This solution, however, is unacceptable due to some legacy issues.
So, how is BC4J treating the insert of CLOB's? Does it issue an insert statement that only puts in the non-CLOB columns and then updates the table with the CLOBs? Or is the something else that I'm missing?
Any help would be greatly appreciated.
-chris

In BC4J, CLOB fields are updated after the row is inserted and an empty CLOB locator has been created in the db. So you may also want to update your textfile trigger to apply on update of the clob field.

Similar Messages

  • BLOB and CLOB data in BI Publisher

    Hello,
    I have an XML file with blob and clob data in it. I am using BI desktop publisher to load the xml file and create the rtf template. I am getting the following error:
    ConfFile: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdoconfig.xml
    Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    Template: C:\work\employee.rtf
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\work\employee.xml
    FOProcessor setLocale: en-us
    Do i need to install anything or am i missing any configuration to read the blob and clob? Please advise
    thanks

    Check this out, hopefully it'll help you
    http://oraclebizint.wordpress.com/2007/11/12/oracle-bi-ee-101332-working-with-clob-fields/
    Fiston

  • Diff b/w bc4j model and ejb model in adf11g

    hi all,
    iam murali iam new for adf 11g i have some dout's in adf11g ,can u please solve my probleam
    what is the difference b/w bc4j componet and ejb componet,how to develop ejb application in adf11g.

    ,how to develop ejb application in adf11gTake a look at this tutorial for starters:
    http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/ejb/ejb.html

  • How to copy a table with LONG and CLOB datatype over a dblink?

    Hi All,
    I need to copy a table from an external database into a local one. Note that this table has both LONG and CLOB datatypes included.
    I have taken 2 approaches to do this:
    1. Use the CREATE TABLE AS....
    SQL> create table XXXX_TEST as select * from XXXX_INDV_DOCS@ext_db;
    create table XXXX_TEST as select * from XXXX_INDV_DOCS@ext_db
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatype
    2. After reading some threads I tried to use the COPY command:
    SQL> COPY FROM xxxx/pass@ext_db TO xxxx/pass@target_db REPLACE XXXX_INDV_DOCS USING SELECT * FROM XXXX_INDV_DOCS;
    Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    CPY-0012: Datatype cannot be copied
    If my understanding is correct the 1st statement fails because there is a LONG datatype in XXXX_INDV_DOCS table and 2nd one fails because there is a CLOB datatype.
    Is there a way to copy the entire table (all columns including both LONG and CLOB) over a dblink?
    Would greatelly appriciate any workaround or ideas!
    Regards,
    Pawel.

    Hi Nicolas,
    There is a reason I am not using export/import:
    - I would like to have a one-script solution for this problem (meaning execute one script on one machine)
    - I am not able to make an SSH connection from the target DB to the local one (although the otherway it works fine) which means I cannot copy the dump file from target server to local one.
    - with export/import I need to have an SSH connection on the target DB in order to issue the exp command...
    Therefore, I am looking for a solution (or a workaround) which will work over a DBLINK.
    Regards,
    Pawel.

  • Function and triggers and procedures

    sorry to asking this question,
    In oracle. we use the function and triggers and procedure.
    for eg:
    if we wrote an trigger for a table. it fires at a time manipulating table. (database contains table contains datas and database also contains triggers likewise function,procedure).
    but my questions?: is
    In my database I kept only tables. no triggers,no function,no procedures. and
    i dont want to kept this triggers, function, procedures in database  Instead of i want to kept this triggers, function, procedures in business logic layers(middle tier)
    is it possible? .
    if yes means, how to write or where to write? please help me, or else send the guidance documents or blog releated to it.

    Subu123,
    the +1 related to Would be great if you can take step back and see the implementation from another angle. First see why do you need DB trigger/function etc.Then check whether it is possible to implement the functionality using ADF BC + feasibility study between 2 approaches(I didn't mean to invoke DB objects from business components, instead checking the feasibility of implement the same functionality in your EntityObj/ViewObj/Service calls )Before making a decision for or against holding fuctions, triggers and procedures in the DB, you have to get the whole picture.
    Think about a trigger outside the DB. What could this be and why or for what is it used?
    All the answers are pointing to 'lets keep them in the DB'. Now there are situation where you don't have a DB or are not allows to use it. Still there can be triggers, only they are implemented in a different way.
    The same can be said for procedures and functions.
    So you have to think about the whole problem and how each sub problem you have to solve work together to resolve the whole problem.
    I'm personally tend to keep the business logic the the DB if the business logic is already there (e.g. I have to migrate an old forms app).
    If I design a new app I tend to keep the logic in java. Only sequences (for generating ids) and some other stuff which is purely db related like cleaning up tables I keep in the DB.
    Timo

  • ADF BC : Ant and XSLT to modify bc4j.xcfg and DataBindings.cpx

    hi
    Before I deploy my ADF BC / ADF Swing application I would like to use Ant to make some changes to bc4j.xcfg and DataBindings.cpx
    (see also "Defining ADF Business Components Runtime Properties for ADF Swing Applications" in the JDeveloper documentation)
    I would like DataBindings.cpx to point to the correct configuration and bc4j.xcfg to only contain the configuration information that is required.
    I created some XSLT transformation stylesheets to help me with that, see this example application:
    http://verveja.footsteps.be/~verveja/files/oracle/AntXsltConnectionSwitchStuff-v0.02.zip
    question
    Does JDeveloper itself provide any features to automatically make changes to DataBindings.cpx (and bc4j.xcfg) before deployment?
    many thanks
    Jan Vervecken

    repost

  • Problem using TAPI triggers and merge statement

    Hi,
    I use Designer tapi triggers on a table. When I try to execute a merge statement, I get the following error:
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value.
    Is there a restriction when using TAPI triggers and merge statements that anyone is aware of?

    No restrictions on MERGE commands that I know of. I have, however, seen the TAPI give inexplicable ORA-06502 errors. It would help to know what line in which procedure or trigger gave the error. That information should have been in the error stack.

  • Display BLOB and CLOB on browser

    Hi All.
    I need to display contents of BLOBs and CLOBs on the browser. They can be any docFlavour eg. .jpg, .gif, .pdf, .doc etc
    Is there some standard way of doing this ???
    If any all possible I would rather not use swing class because of its footprint and its slow performance over the net.

    Hi !
    Just in case anyone read this and is willing to comment on it...
    I have one BLOB and one CLOB column in the same record.
    I have been able to stream documents into and out of the BLOB's incl. MS .doc Also I have been able to get the content from BLOB and write it to a target directory.
    However I am having odd problems with CLOB, a simple text file. My servlet attempts to read the CLOB and does create the output file in the target directory, but does not copy the content over. It also returns 0 for clobLength !?! Here is the stub-code :
    ResultSet clobRS = thisStmt.executeQuery (
    "SELECT ATextMsg " +
    "FROM ... " +
    "WHERE ... " );
    clobRS.next();
    CLOB thisCLOB = ((OracleResultSet) clobRS).getCLOB("ATextMsg");
    int chunkSize = thisClob.getChunkSize();
    System.out.println("chunkSize is " + chunkSize); // default us 8132...
    char [] textBuffer = new char[chunkSize];
    String targetFile = targetDir + "retrieved_" + fileName;
    File thisFile = new File(targetFile); // it does create an empty target file...
    // read content as ASCII (text) content...
    FileOutputStream thisFileOutputStream = new FileOutputStream(thisFile);
    OutputStreamWriter thisWriter = new OutputStreamWriter(thisFileOutputStream);
    BufferedWriter thisBufferedWriter = new BufferedWriter(thisWriter);
    // things go wrong here, returns length of 0, why ?!?
    long clobLength = thisClob.length();
    System.out.println("clobLength is " + clobLength);
    // flush to targetFile - but since clobLength=0, nothing gets copied over...
    for (position=1; position<=clobLength; position+=chunkSize)
    int charsRead = thisClob.getChars(position, chunkSize, textBuffer);
    thisBufferedWriter.write(testBuffer);
    Since the clobLength is 0, obviously it will not copy from the database CLOB to the file.
    Manually change the clobLength = 8132, recompile and run, then it copies some junk to the targetFile, certainly not the textual data in the CLOB itself.
    The BLOB is fine...
    Can someone comment on this please and if possible, give me a hint on where I might have gone wrong with a simple text file ???

  • How to use analog Triggering and External clock scan

    Hi, there. I want to measure the engine cylinder pressure with an PXI6070-E card and BEI encoder. I have tried using Cont Acq&Graph ExtScanClk D-Trig.vi and Cont Acq&Graph ExtScanClk Soft A-Trig.vi , but they don't work. What I did was to connect a 50HZ pulse to PFI0 (analog triggering, I changed the code from digital triggering to analog triggering), and a 100K pulse to PFI7 (startscan), and an 50 HZ analog signal to ACH0. But the code always says: timeout. If I use internal clock, it works fine. Could you please give me some help? THANKS A LOT!

    Hey Wyuan,
    I tested the Cont Acq&Graph ExtScanClk Soft A-Trig.vi and it worked fine. However, the Cont Acq&Graph ExtScanClk D-Trig.vi has a small error in its logic that will prevent the data from ever being displayed to the graph. In order to run the examples you need to connect a trigger to pin 11 and a scan clock to pin 38. A 10kHz square wave would be fine for the clock signal and just a single pulse would work for the digital trigger.
    One additional think to keep in mind is the grounding. You might need to connect you ground from your signals to a DGND pin. I am including the two programs that I used for the test.
    I hope this helps,
    Joshua
    Attachments:
    Cont_Acq&Graph_ExtScanClk_D-Trig.vi ‏121 KB
    Cont_Acq&Graph_ExtScanClk_Soft_A-Trig.vi ‏153 KB

  • Sql query to  know the number of triggers and cursors present in a schema?

    friends,is there any way to know the number of triggers and cursors preseent in a schema.
    thanks in advance..

    what do you mean by triggers in a schema? is it the triggers owned by that schema? or the triggers applied on tables owned by that schema? remember you may own triggers applied on the tables belong to other schemas. Anyways, all this information can be extracted from oracle dictionary using a combination of all_triggers and all_tables.
    As far as cursors, please elaborate. Do you mean cursors declared in PL/SQL blocks?

  • Triggering and reading on two HP/Agilent 34401A DMMs at same time

    Hi folks,
    I'm VERY new to LabVIEW and need some help with a measurement.  I'm using LV 8.2 with all equipment on GPIB.  I have two 34401A multimeters, triggered externally using an HP 33120A function generator.   I've downloaded the example vi's and drivers and everything works fine.  My problem is with the speed of the triggering and the synchronization between the two multimeters on the same trigger.  I've read the manual and for this multimeter, it claims it can be triggered and read over GPIB at 1kHz (display off, auto range off, delay= 0, 4.5 digits).  I'm finding it is nowhere near this speed.  The fastest I have successfully triggered and recorded the data was at 100 Hz, anything higher and it no longer stays in sync with the trigger (i.e. for 200 measurements at 100 Hz, I'm getting all 200 measurements, but over 3-5 seconds).  The trigger speed is the first problem.  The second problem is getting the two meters to take a reading at the same time.  One meter always lags the other (or vice versa) by 1 to 3 readings.  My goal is to continuously (for about 60 seconds) read both multimeters as fast as possible and at the same time (250-500 Hz would be fantastic) and write it to a file.  Can anyone give me some advice on this?  Is a software trigger the way to go?  Is there some limitation with GPIB that it cannot read/write to two devices this fast? 
    Thanks!
    P.S. I've been experimenting mostly with the example code provided by NI and a .vi posted in this forum thread (http://sine.ni.com/niforum/niforumforumDU=http://forums.ni.com/ni/board/messageboard.id=170&message....) hp34401a_-_testing.vi from Kunal.  If anyone could share some other example vi's it would be very helpful!

    Hi plasma420,
    I should have read your post more carefully - was thinking it was a 1 sec acquisition, not 1 minute!
    Getting your LabVIEW app to reliably respond to a measurement (detect/read) every 2 to 4 ms is going to be tough - especially if in a multi-tasking OS environment.  On a 2GHz box running a normal Windows XP or 2K install,  I suspect you could see an occasional "hiccup" even at 100Hz.  A bit of searching the forum turned up this old-but-still-valuable (even entertaining) post related to improving determinism of DAQ applications on a PC.
    Observation: The listed max measurement-rate of the 34401 (1000Hz) may assume the GPIB-bus is dedicated to one instrument - the requirement to read from two instruments sequentially, may necessarily increase time spent servicing each trigger - decreasing maximum theoretical throughput.
    The first rule for "high-speed" multi-sample DAQ - especially under Windows - is to make it a hardware task instead of a software loop;  the 34401 doesn't seem well suited here.  I hate to suggest this, but... have you considered purchasing one of NIs multi-channel DAQ devices?  With a $360 PCI 6010 + cable and break-out box, you could have one of the LabVIEW DAQ examples running in ~ 30 min.  The 6010 was the cheapest 16-bit board I could find, ask your sales-rep for other alternatives if you go this route...
    Cheers!
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Trigger, triggers and more triggers

    I've been given theenviable task of reviewing the triggers on a legacy application, as an example a typical table will have between 1 and 10 before insert triggers and I've been asked to validate the logic in the triggers.
    Does anyone know if there are any tools available to help with this, so far having looked at the first table (I was asked to loko at this specifically because someone wants to add yet another trigger) I'm starting to lose the will to live, 4 of the triggers currently in place alter similar fields makeing the results indeterminate. I have a nasty feeling the only way to be certain is to cross check every trigger and compile some kind of cross reference I'd really like some kind of toolset to make this easier.
    So far my analysis is the logic is horribly broken and really the whole shambles should be ripped out an re-wrtten properly this time, preferably fixing the problems in the front end rather than trying to bandage the data using triggers..

    You may have to look into dba_triggers and dba_dependenices too see how may triggers and if all depned on same object,
    This is why Tom kyte recommands using inline code instead of triggers.
    Good luck,

  • bc4j:setAttribute and validater

    Hi, the parser bug reported in this thread, has it been solved or is there any work around for it?
    UIX/XML: <bc4j:setAttribute> and <validater>
    Basically I want serverside BC4J field validation, there might be another way to get it done?
    Thanks, Jan

    Jan,
    Sorry, the bug fix has not been released externally. Registering the below UIExtension should work, though.
    Hope this helps,
    Ryan Pollock
    UIX Team
    import oracle.cabo.share.xml.ParserManager;
    import oracle.cabo.ui.UIConstants;
    import oracle.cabo.ui.UIExtension;
    import oracle.cabo.ui.laf.LookAndFeel;
    import oracle.cabo.ui.validate.ServerValidater;
    import oracle.cabo.ui.xml.parse.ClientValidaterFactory;
    public class FixValidate implements UIExtension
    public void registerSelf(ParserManager manager)
    // Work around UIX bug with ServerValidater parsing
    manager.register(ServerValidater.class,
    UIConstants.MARLIN_NAMESPACE,
    ClientValidaterFactory.sharedInstance());
    public void registerSelf(LookAndFeel laf)
    }

  • BC4J ViewLink and CURSORS

    I am using BC4J ViewObjects and ViewLinks. With ViewObjects method closeFreedStatements() works fine and closes Open Cursor in the database. How should I close Rowset and Statements when using ViewObjects trought ViewLinks?

    Hi,
    You could cast the RowIterator from the detail set from a viewlink to ViewRowSetImpl and get the ViewObjectImpl of the detail vo.
    RowIterator ri; //detail rowset
    ViewRowSetImpl rsi = (ViewRowSetImpl) ri;
    ((ViewObjectImpl) rsi.getViewObject()).closeFreedStatements();
    Yvonne

  • Time bound policy :: CPSC Server down :: Re-triggering and Notification

    I have some Service Requests which are triggered by Time bound policy that execute, say for eg; Power Up some servers. But during a scenario of CPSC server being down during the time of Time bound Service request triggering, none of the requests are triggered  and also after the CPSC server is up again after few minutes past the triggering time. Is there a way to get notified if a Time bound policy is not triggered, like receiving an email? 
    Please let me know if there is any possible way to get notified during failure of time bound policy request triggering.
    Thanks,
    Anish

    Hi,
    According to event log, Winlogon process takes a long time to handle logoff event. That's to say winlogon process is waiting for response to logoff.  
    According to your description after, this problem is most probably caused by Avecto. You can try to disable or uninstall it temporarily for test.
    To make further troubleshoot with this problem, you can try to use WPT (Windows Performance Tool) to make troubleshoot.
    http://blogs.technet.com/b/askpfeplat/archive/2013/03/22/troubleshooting-windows-performance-issues-using-the-windows-performance-recorder.aspx
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Maybe you are looking for

  • Problem transferring from iPhoto to iPhone4

    I have imported pictures taken by my iPhone4 to iPhoto, however, when I put them into albums and sync, the photos will not transfer back to the iPhone4.

  • No songs yet memory is used

    I just got a new ipod nano (1 GB) and when i connected it to my computer, it said that i have already used 887.7 mb of memory yet i haven't added any songs or photos yet! The playlist is empty, so what exactly is taking up all of this memory? Thanks

  • SSRS Reporting not working Properly.

    On testing server i had crested a pwa and ssrs report.After that i had take the backup of the testing server database and mount the pwa by using the same database on different server and again deploy the ssrs reports by giving the path in new server.

  • Demo WD ABAP Application

    Hello,           I need to develop a demo WD ABAP application in the  first screen take the sales organization as select option parmaters           In second screen show all sales order items, with in that sales organization in an ALV.how can it be d

  • Smart Build - push - odd timing problem

    I'm using a push smart build with nine images. KN will show all nine, but only acknowledges the existence of eight and the timing is off... the last image is onscreen for too long even if I click to initiate a page transition.