BC4J, ViewObject: setWhereClause vs ViewCriteria

1.What is the difference between using setWhereClause and ViewCriteria object?
2.When is better to use the first one and when the second?
3.When used both, which one has priority, or are they anded together?
Could anybody answer these questions?
Thanks, Tom

Manuel,
There is also another method, getEstimatedRowCount(), which is the most efficient. It will perform a
SELECT COUNT(*) FROM (your query with conditions)
which puts all the work in the database and just returns the count.
getFetchedRowCount() just tells you how many have been fetched so far and getRowCount() actually fetches all the rows into view/entity cache and then returns the total.

Similar Messages

  • A bug? BC4J ViewObject where clause change doesn't affect view contents

    Hi!
    I've found the following interesting behaviour (maybe a bug?) of BC4J ViewObject caching:
    1) make a viewobject with where clause and 1 parameter in it.
    2) set parameter binding to some value
    3) execute query
    4) then change viewobject's where clause, but leave parameter binding intact
    5) execute query again
    6) view object contents haven't changed!
    actually, changing where clause text should make view object requery data from the database instead of using cached rows...
    If to add a call to viewobject.clearCache() before second viewobject.executeQuery(), then everything works fine and view object's contents are changed.
    Does anybody have any ideas about this? Or is this a some kind of a feature, or it is already fixed in a newer version of JDev?
    Thnx!
    PS. JDeveloper version 9.0.3.4 (build 1247).

    delete message

  • BC4J - ViewObject not returning latest data

    BC4J - ViewObject not returning latest data. Some kind of EO/VO Cache Latency Issue.
    I have an edit page that presents a drop-down list which is suppose to display * un-assigned * messages, but does not. The drop-down list is using an <jbo:InputSelect> tag that gets values from a ViewObject (UnAssignedMessageView ) which issues the query listed below. Note, the ViewObject is not based on an Entity Object.
    (Query in UnAssignedMessageView)
    select      message.message_desc_short, message.message_id
    from     fmm.message
    where      message.message_id not in (select cardmessage.message_id from fmm.card_message)
    and message.message_id != 0     
    (from the edit.jsp)
    <jbo:ApplicationModule id="am" configname="com.maxmcbyte.fmm.model.ModelModule.ModelModuleLocal" releasemode="Reserved" />
    <jbo:DataSource id="ds" appid="am" viewobject="CardMessageView1" />           <<****** The VO where the inserts/updates are recorded.
    <jbo:DataSource id="ds2" appid="am" viewobject="MessageUnAssignedView" />     <<****** The VO for the unassigned message drop-down-list.
    The problem is at step 3.
    Starting with 3 Unassigned Messages.
    Step 1: enter new record AND select a MESSAGE_ID from the drop-down list.
    Step 2: commit the transaction.
    Step 3: enter another record AND select a MESSAGE_ID from the drop-down list.     <<****** the list should now be displaying 2 unassigned messages but is displaying 3.
    Note, if I check the database after step 3 using the same query as in the UnAssignedMessageView I get the correct result. I guess I'm not understanding how BC4J ViewObject Caching is working. It is strange that even after I commit the record that the cache is not updated.
    I have read the docs and will have to re-read them again * but * it would be REAL NICE to see an illustration of "A DAY IN THE LIFETIME OF DATA IN BC4J" for dummies like me.
    Can anyone tell me what I'm missing here AND what specifically needs to be done?
    Thanks All,
    Bill G...

    Well, I figured it out * BUT * this is the sort of thing that I'll bet stumps a lot of new users * AND * should be posted to a "Gotch-Ya" list.
    I'd still like to see an illustration of "A DAY IN THE LIFE OF DATA IN BC4J"
    Bill G...
    <jbo:ApplicationModule id="am" configname="com.maxmcbyte.fmm.model.ModelModule.ModelModuleLocal" releasemode="Reserved" />
    <jbo:DataSource id="ds1" appid="am" viewobject="CardMessageView1" />
    <jbo:DataSource id="ds2" appid="am" viewobject="MessageUnAssignedView" />
    <%-- adding this did the trick --%>
    <%
    ViewObject view2 = ds2.getRowSet().getViewObject();
    view2.executeQuery();
    view2.first();
    %>

  • ViewObject.setWhereClause() strangeness.

    I've had an interesting problem when using ViewObjects:
    A JSP page uses a ViewObject, and sets the where clause as follows:
    view.setWhereClause("Vendorid = :0");
    view.setWhereClauseParam(0,anId);
    view.executeQuery();
    The query executes just fine. A subsequent JSP page uses the same ViewObject, and sets the where clause as follows:
    view.setWhereClause("Id = :0");
    view.setWhereClauseParam(0,anId);
    view.executeQuery();
    The problem occurs on the second use of the ViewObject: the row is not found! Upon investigation (Using Diagnostic.properties) I discovered that remenants of the where clause from the first use of the ViewObject remain. The query that actually gets executed is as follows:
    [169] jbo.server(int) SELECT Ricscontent.ID, Ricscontent.PARENTID, Ricscontent.VENDORID, ...cut... FROM RICSCONTENT Ricscontent WHERE (Id = :0) AND Ricscontent.VENDORID = :1
    As you can see, the where clause includes the Vendorid. When executing the second query first, it works just fine.
    Am I doing something wrong, or is this a defect? Is there a work-around to this problem? Any help would be greatly appreciated.
    Thanks,
    David
    I've included the diagnostic log below:
    "C:\Program Files\Oracle\JDeveloper 3.1\java1.2\jre\bin\javaw.exe" -mx50m -classpath "O:\\_pages;O:\;C:\Program Files\Oracle\JDeveloper 3.1\lib\webtogo.jar;C:\Program Files\Oracle\JDeveloper 3.1\lib\xmlparser.jar;C:\Program Files\Oracle\JDeveloper 3.1\lib\jdev-rt.zip;C:\Program Files\Oracle\JDeveloper 3.1\lib\jbcl2.0.zip;C:\Program Files\Oracle\JDeveloper 3.1\lib\jdev-rt.zip;C:\Program Files\Oracle\JDeveloper 3.1\lib\connectionmanager.zip;C:\Program Files\Oracle\JDeveloper 3.1\lib\jbohtml.zip;C:\Program Files\Oracle\JDeveloper 3.1\lib\jbojdbcpatch.zip;C:\Program Files\Oracle\JDeveloper 3.1\jdbc\lib\oracle8.1.6\classes12.zip;C:\Program Files\Oracle\JDeveloper 3.1\lib\jbomt.zip;C:\Program Files\Oracle\JDeveloper 3.1\lib\jboorasql.zip;C:\Program Files\Oracle\JDeveloper 3.1\lib\jboremote.zip;C:\Program Files\Oracle\JDeveloper 3.1\lib\jndi.jar;C:\Program Files\Oracle\JDeveloper 3.1\lib\xmlparserv2.jar;C:\Program Files\Oracle\JDeveloper 3.1\lib\ojsp.jar;C:\Program Files\Oracle\JDeveloper 3.1\lib\ojc.jar;C:\Program Files\Oracle\JDeveloper 3.1\jswdk-1.0.1\lib\servlet.jar;C:\Program Files\Oracle\JDeveloper 3.1\java1.2\jre\lib\rt.jar" oracle.jdeveloper.debugger.ServletMain \RICSJsp_html\RICSFindVendor.jsp "L:\htmlroot" "C:\Program Files\Oracle\JDeveloper 3.1\lib"
    log3: oracle.jsp.JspServlet: init
    log3: Loading from CLASSPATH com_luxurydomain_rics_dal_DalModule.properties
    log3: Diagnostics: Routing diagnostics to standard output (use -Djbo.debugoutput=silent to remove)
    [00] oracle.jbo(init) Diagnostic Properties: Timing:false Functions:true Linecount:true Threshold:6log3:
    [01] JboInitialContextFactory.getInitialContext(Hashtable) BC4JDeployPlatform: LOCALlog3:
    [02] PropertyManager.loadProperties(Hashtable) {{ begin Loading BC4J properties
    log3:
    [03] PropertyManager.loadProperties(Hashtable) -----------------------------------------------------------log3:
    [04] util.Properties,(Properties) BC4J Property DeployPlatform='LOCAL' -->(SessionImpl) from Client Environmentlog3:
    [05] util.Properties,(Properties) BC4J Property ConnectionMode='0' -->(SessionImpl) from System Defaultlog3:
    [06] util.Properties,(Properties) BC4J Property jbo.fetch.mode='AS.NEEDED' -->(MetaObjectManager) from System Defaultlog3:
    [07] util.Properties,(Properties) Skipping empty Property JBODynamicObjectsPackage from System Defaultlog3:
    [08] util.Properties,(Properties) BC4J Property MetaObjectContextFactory='oracle.jbo.server.xml.DefaultMomContextFactory' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resourcelog3:
    [09] util.Properties,(Properties) BC4J Property java.naming.factory.initial='oracle.jbo.common.JboInitialContextFactory' -->(MetaObjectManager) from Client Environmentlog3:
    [10] util.Properties,(Properties) BC4J Property MetaObjectContext='oracle.jbo.server.xm l.XMLContextImpl' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resourcelog3:
    [11] util.Properties,(Properties) BC4J Property IsLazyLoadingTrue='true' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
    log3:
    [12] util.Properties,(Properties) BC4J Property ActivateSharedDataHandle='false' -->(MetaObjectManager) from System Defaultlog3:
    [13] util.Properties,(Properties) Skipping empty Property HandleName from System Defaultlog3:
    [14] util.Properties,(Properties) Skipping empty Property Factory-Substitution-List from System Defaultlog3:
    [15] util.Properties,(Properties) Skipping empty Property jbo.project from System Defaultlog3:
    [16] util.Properties,(Properties) BC4J Property jbo.max.cursors='50' -->(MetaObjectManager) from System Defaultlog3:
    [17] util.Properties,(Properties) BC4J Property jbo.assoc.consistent='true' -->(MetaObjectManager) from System Defaultlog3:
    [18] util.Properties,(Properties) BC4J Property jbo.default.language='en' -->(MetaObjectManager) from System Defaultlog3:
    [19] util.Properties,(Properties) BC4J Property jbo.default.country='US' -->(MetaObjectManager) from System Defaultlog3:
    [20] util.Properties,(Properties) BC4J Property jbo.SQLBuilder='Oracle' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resourcelog3:
    [21] util.Properties,(Properties) BC4J Property jbo.jdbc.trace='false' -->(MetaObjectManager) from System Defaultlog3:
    [22] util.Properties,(Properties) BC4J Property jbo.debug.prefix='DBG' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resourcelog3:
    [23] util.Properties,(Properties) BC4J Property jbo.debugoutput='console' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resourcelog3:
    [24] util.Properties,(Properties) BC4J Property jbo.logging.show.timing='false' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resourcelog3:
    [25] util.Properties,(Properties) BC4J Property jbo.logging.show.function='true' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resourcelog3:
    [26] util.Properties,(Properties) BC4J Property jbo.logging.show.level='false' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resourcelog3:
    [27] util.Properties,(Properties) BC4J Property jbo.logging.show.linecount='true' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resourcelog3:
    [28] util.Properties,(Properties) BC4J Property jbo.logging.trace.threshold='6' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resourcelog3:
    [29] util.Properties,(Properties) BC4J Property jbo.jdbc.driver.verbose='false' -->(Diagnostic) from System Default
    log3:
    log3: Diagnostics: Routing diagnostics to standard output (use -Djbo.debugoutput=silent to remove)
    [30] oracle.jbo(init) Diagnostic Properties: Timing:false Functions:true Linecount:true Threshold:6log3:
    [31] util.Properties,(String) WARNING: Unused property: LC='Calling Function' found in /oracle/jbo/common/Diagnostic.properties resourcelog3:
    [32] PropertyManager.loadProperties(Hashtable) {{ finished loading BC4J properties log3:
    [33] PropertyManager.loadProperties(Hashtable) -----------------------------------------------------------log3:
    [34] oracle.jbo(reportVMProperties) JavaVMVersion: 1.2.280 odvlog3:
    [35] oracle.jbo(reportVMProperties) JavaVMVendor: Oracle Corp.log3:
    [36] oracle.jbo(reportVMProperties) JavaVMName: OJVM VMlog3:
    [37] oracle.jbo(reportVMProperties) OperatingSystemName: Windows NTlog3:
    [38] oracle.jbo(reportVMProperties) OperatingSystemVersion: 5.0log3:
    [39] oracle.jbo(reportVMProperties) OperatingSystemUsername: dgreenlog3:
    [40] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/dal.xml file
    log3:
    [41] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/DalModule.xml file
    log3:
    [42] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/RicsannotationView.xml file
    log3:
    [43] oracle.jbo(<init>) ViewObject Impl's default fetch mode = 0log3:
    [44] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/Ricsannotation.xml file
    log3:
    [45] oracle.jbo(getInterface) Reached getInterface
    log3:
    [46] oracle.jbo(getInterface) Oracle SQL Builder Version 3.0.0.0.0log3:
    [47] oracle.jbo(populateJboTypeMapEntries) OracleSQLBuilder: populating ORACLE TypeMap entrieslog3:
    [48] jbo.server(<clinit>) UtilMessageBundle (language base) being initialized
    log3:
    [49] Locale,.java(boolean) Stringmanager using default locale: 'null'log3:
    [50] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/RicscategoryView.xml file
    log3:
    [51] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/Ricscategory.xml file
    log3:
    [52] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/RicscontentView.xml file
    log3:
    [53] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/Ricscontent.xml file
    log3:
    [54] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/RicscontentcategoryView.xml file
    log3:
    [55] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/Ricscontentcategory.xml file
    log3:
    [56] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/RicsratingView.xml file
    log3:
    [57] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/Ricsrating.xml file
    log3:
    [58] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/RicsthemesView.xml file
    log3:
    [59] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/Ricsthemes.xml file
    log3:
    [60] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/RicsurlView.xml file
    log3:
    [61] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/Ricsurl.xml file
    log3:
    [62] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/RicsvendorView.xml file
    log3:
    [63] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/Ricsvendor.xml file
    log3:
    [64] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001386Link.xml file
    log3:
    [65] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001386Assoc.xml file
    log3:
    [66] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001383Link.xml file
    log3:
    [67] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001383Assoc.xml file
    log3:
    [68] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001368Link.xml file
    log3:
    [69] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001368Assoc.xml file
    log3:
    [70] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001370Link.xml file
    log3:
    [71] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001370Assoc.xml file
    log3:
    [72] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001371Link.xml file
    log3:
    [73] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001371Assoc.xml file
    log3:
    [74] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001390Link.xml file
    log3:
    [75] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001390Assoc.xml file
    log3:
    [76] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001391Link.xml file
    log3:
    [77] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001391Assoc.xml file
    log3:
    [78] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001379Link.xml file
    log3:
    [79] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001379Assoc.xml file
    log3:
    [80] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001374Link.xml file
    log3:
    [81] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001374Assoc.xml file
    log3:
    [82] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001375Link.xml file
    log3:
    [83] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001375Assoc.xml file
    log3:
    [84] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC001369Link.xml file
    log3:
    [85] oracle.jbo(boolean) Loading from /com/luxurydomain/rics/dal/SysC0013 69Assoc.xml file
    log3:
    [86] lang.String,(Session) Created root application module: 'com.luxurydomain.rics.dal.DalModule'log3:
    [87] lang.String,(Session) Locale is: 'en_US'
    log3:
    [88] oracle.jbo(create) Connected to Oracle JBO Server - Version: 3.1.6.81.0log3:
    [89] oracle.jbo(loadImpl) Using DatabaseTransactionFactory implementation oracle.jbo.server.DatabaseTransactionFactorylog3:
    [90] oracle.jbo(initTransaction) DBTransactionImpl Max Cursors is 50log3:
    [91] oracle.jbo(doRegisterDefaultDriver) OracleSQLBuilder: Registered Oracle JDBC driverlog3:
    [92] oracle.jbo(initTransaction) Trying connection/1: url='jdbc:oracle:thin:RICS/riCs236@localhost:1521:DEVELOP4'...log3:
    [93] oracle.jbo(initTransaction) Successfully logged in
    log3:
    [94] oracle.jbo(initTransaction) JDBCDriverVersion: 8.1.6.0.0
    log3:
    [95] oracle.jbo(initTransaction) DatabaseProductName: Oraclelog3:
    [96] oracle.jbo(initTransaction) DatabaseProductVersion: Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production With the Partitioning option JServer Release 8.1.6.0.0 - Productionlog3:
    [97] oracle.jbo(getDefaultMode) EntityRowSetImpl's jbo.assoc.consistent = true (1)
    log3:
    [98] oracle.jbo(createColumnList) Column count: 12log3:
    [99] jbo.server(int) ViewObject: RicsvendorView Query Statement: log3:
    [100] jbo.server(int) SELECT Ricsvendor.ID, Ricsvendor.VENDORNAME, Ricsvendor.ADDRESS1, Ricsvendor.ADDRESS2, Ricsvendor.CITY, Ricsvendor.STATE, Ricsvendor.COUNTRY, Ricsvendor.ZIP, Ricsvendor.DESCRIPTION, Ricsvendor.KEYWORDS, Ricsvendor.NOTES FROM RICSVENDOR Ricsvendor WHERE (Ricsvendor.ID IS NOT NULL )log3:
    [101] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [102] afterRollback.oracle(TransactionEvent) RicsvendorView notify ROLLBACK ...
    log3:
    [103] oracle.jbo(clearQueryCollectionCache) Clear QueryCollection in cache...log3:
    [104] oracle.jbo(createColumnList) Column count: 12log3:
    [105] jbo.server(int) ViewObject: RicsvendorView Query Statement: log3:
    [106] jbo.server(int) SELECT Ricsvendor.ID, Ricsvendor.VENDORNAME, Ricsvendor.ADDRESS1, Ricsvendor.ADDRESS2, Ricsvendor.CITY, Ricsvendor.STATE, Ricsvendor.COUNTRY, Ricsvendor.ZIP, Ricsvendor.DESCRIPTION, Ricsvendor.KEYWORDS, Ricsvendor.NOTES FROM RICSVENDOR Ricsvendor WHERE (Ricsvendor.ID IS NOT NULL )
    log3:
    [107] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [108] afterRollback.oracle(TransactionEvent) Ricscontent_SysC001369Assoc_RicscontentView notify ROLLBACK ... log3:
    [109] oracle.jbo(clearQueryCollectionCache) Clear QueryCollection in cache...
    log3:
    [110] oracle.jbo(createColumnList) Column count: 17log3:
    [111] jbo.server(int) ViewObject: Ricscontent_SysC001369Assoc_RicscontentView Query Statement: log3:
    [112] jbo.server(int) SELECT Ricscontent.ID, Ricscontent.PARENTID, Ricscontent.VENDORID, Ricscontent.CONTENTTYPE, Ricscontent.TITLE, Ricscontent.DESCRIPTION, Ricscontent.KEYWORDS, Ricscontent.PREVVERSION, Ricscontent.NEXTVERSION, Ricscontent.SUBMITTEDBY FROM RICSCONTENT Ricscontent WHERE (Ricscontent.VENDORID = :1)log3:
    [113] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [114] lang.Object[],(PreparedStatement) Binding param 1: 3log3:
    [115] postChanges.oracle(TransactionEvent) Saving transaction changes...log3:
    [116] jbo.server(int) ViewObject: RicsvendorView Query Statement:
    log3:
    [117] jbo.server(int) SELECT Ricsvendor.ID, Ricsvendor.VENDORNAME, Ricsvendor.ADDRESS1, Ricsvendor.ADDRESS2, Ricsvendor.CITY, Ricsvendor.STATE, Ricsvendor.COUNTRY, Ricsvendor.ZIP, Ricsvendor.DESCRIPTION, Ricsvendor.KEYWORDS, Ricsvendor.NOTES FROM RICSVENDOR Ricsvendor WHERE (Id = :0)log3:
    log3: QUERY: SELECT Ricsvendor.ID, Ricsvendor.VENDORNAME, Ricsvendor.ADDRESS1, Ricsvendor.ADDRESS2, Ricsvendor.CITY, Ricsvendor.STATE, Ricsvendor.COUNTRY, Ricsvendor.ZIP, Ricsvendor.DESCRIPTION, Ricsvendor.KEYWORDS, Ricsvendor.NOTES FROM RICSVENDOR Ricsvendor WHERE (Id = :0)
    [118] oracle.jbo(createColumnList) Column count: 12log3:
    [119] jbo.server(int) ViewObject: RicsvendorView Query Statement: log3:
    [120] jbo.server(int) SELECT Ricsvendor.ID, Ricsvendor.VENDORNAME, Ricsvendor.ADDRESS1, Ricsvendor.ADDRESS2, Ricsvendor.CITY, Ricsvendor.STATE, Ricsvendor.COUNTRY, Ricsvendor.ZIP, Ricsvendor.DESCRIPTION, Ricsvendor.KEYWORDS, Ricsvendor.NOTES FROM RICSVENDOR Ricsvendor WHERE (Id = :0)log3:
    [121] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [122] lang.Object[],(PreparedStatement) Binding param 1: 3log3:
    [123] oracle.jbo(createColumnList) Column count: 17log3:
    [124] jbo.server(int) ViewObject: RicscontentView Query Statement: log3:
    [125] jbo.server(int) SELECT Ricscontent.ID, Ricscontent.PARENTID, Ricscontent.VENDORID, Ricscontent.CONTENTTYPE, Ricscontent.TITLE, Ricscontent.DESCRIPTION, Ricscontent.KEYWORDS, Ricscontent.PREVVERSION, Ricscontent.NEXTVERSION, Ricscontent.SUBMITTEDBY FROM RICSCONTENT Ricscontent WHERE (Vendorid = :0 AND Contenttype = 'restaurant') AND Ricscontent.VENDORID = :1log3:
    [126] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [127] lang.Object[],(PreparedStatement) Binding param 1: 3log3:
    [128] lang.Object[],(PreparedStatement) Binding param 2: 3log3:
    [129] oracle.jbo(createColumnList) Column count: 17log3:
    [130] jbo.server(int) ViewObject: RicscontentView Query Statement: log3:
    [131] jbo.server(int) SELECT Ricscontent.ID, Ricscontent.PARENTID, Ricscontent.VENDORID, Ricscontent.CONTENTTYPE, Ricscontent.TITLE, Ricscontent.DESCRIPTION, Ricscontent.KEYWORDS, Ricscontent.PREVVERSION, Ricscontent.NEXTVERSION, Ricscontent.SUBMITTEDBY FROM RICSCONTENT Ricscontent WHERE (Vendorid = :0 AND Contenttype = 'hotel') AND Ricscontent.VENDORID = :1log3:
    [132] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [133] lang.Object[],(PreparedStatement) Binding param 1: 3log3:
    [134] lang.Object[],(PreparedStatement) Binding param 2: 3log3:
    [135] afterRollback.oracle(TransactionEvent) RicsvendorView notify ROLLBACK ... log3:
    [136] oracle.jbo(clearQueryCollectionCache) Clear QueryCollection in cache...log3:
    [137] oracle.jbo(createColumnList) Column count: 12log3:
    [138] jbo.server(int) ViewObject: RicsvendorView Query Statement: log3:
    [139] jbo.server(int) SELECT Ricsvendor.ID, Ricsvendor.VENDORNAME, Ricsvendor.ADDRESS1, Ricsvendor.ADDRESS2, Ricsvendor.CITY, Ricsvendor.STATE, Ricsvendor.COUNTRY, Ricsvendor.ZIP, Ricsvendor.DESCRIPTION, Ricsvendor.KEYWORDS, Ricsvendor.NOTES FROM RICSVENDOR Ricsvendor WHERE (Id = :0)log3:
    [140] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [141] lang.Object[],(PreparedStatement) Binding param 1: 3log3:
    [142] afterRollback.oracle(TransactionEvent) Ricscontent_SysC001369Assoc_RicscontentView notify ROLLBACK ...
    log3:
    [143] oracle.jbo(clearQueryCollectionCache) Clear QueryCollection in cache...log3:
    [144] oracle.jbo(createColumnList) Column count: 17log3:
    [145] jbo.server(int) ViewObject: Ricscontent_SysC001369Assoc_RicscontentView Query Statement: log3:
    [146] jbo.server(int) SELECT Ricscontent.ID, Ricscontent.PARENTID, Ricscontent.VENDORID, Ricscontent.CONTENTTYPE, Ricscontent.TITLE, Ricscontent.DESCRIPTION, Ricscontent.KEYWORDS, Ricscontent.PREVVERSION, Ricscontent.NEXTVERSION, Ricscontent.SUBMITTEDBY FROM RICSCONTENT Ricscontent WHERE (Ricscontent.VENDORID = :1)log3:
    [147] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [148] lang.Object[],(PreparedStatement) Binding param 1: 3log3:
    [149] afterRollback.oracle(TransactionEvent) RicscontentView notify ROLLBACK ... log3:
    [150] oracle.jbo(clearQueryCollectionCache) Clear QueryCollection in cache...log3:
    [151] afterRollback.oracle(TransactionEvent) RicsvendorView notify ROLLBACK ...
    log3:
    [152] oracle.jbo(clearQueryCollectionCache) Clear QueryCollection in cache...log3:
    [153] oracle.jbo(createColumnList) Column count: 12log3:
    [154] jbo.server(int) ViewObject: RicsvendorView Query Statement: log3:
    [155] jbo.server(int) SELECT Ricsvendor.ID, Ricsvendor.VENDORNAME, Ricsvendor.ADDRESS1, Ricsvendor.ADDRESS2, Ricsvendor.CITY, Ricsvendor.STATE, Ricsvendor.COUNTRY, Ricsvendor.ZIP, Ricsvendor.DESCRIPTION, Ricsvendor.KEYWORDS, Ricsvendor.NOTES FROM RICSVENDOR Ricsvendor WHERE (Id = :0)log3:
    [156] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [157] lang.Object[],(PreparedStatement) Binding param 1: 3log3:
    [158] afterRollback.oracle(TransactionEvent) Ricscontent_SysC001369Assoc_RicscontentView notify ROLLBACK ... log3:
    [159] oracle.jbo(clearQueryCollectionCache) Clear QueryCollection in cache...log3:
    [160] oracle.jbo(createColumnList) Column count: 17log3:
    [161] jbo.server(int) ViewObject: Ricscontent_SysC001369Assoc_RicscontentView Query Statement: log3:
    [162] jbo.server(int) SELECT Ricscontent.ID, Ricscontent.PARENTID, Ricscontent.VENDORID, Ricscontent.CONTENTTYPE, Ricscontent.TITLE, Ricscontent.DESCRIPTION, Ricscontent.KEYWORDS, Ricscontent.PREVVERSION, Ricscontent.NEXTVERSION, Ricscontent.SUBMITTEDBY FROM RICSCONTENT Ricscontent WHERE (Ricscontent.VENDORID = :1)log3:
    [163] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [164] lang.Object[],(PreparedStatement) Binding param 1: 3log3:
    [165] afterRollback.oracle(TransactionEvent) RicscontentView notify ROLLBACK ... log3:
    [166] oracle.jbo(clearQueryCollectionCache) Clear QueryCollection in cache...log3:
    [167] postChanges.oracle(TransactionEvent) Saving transaction changes...log3:
    [168] jbo.server(int) ViewObject: RicscontentView Query Statement: log3:
    [169] jbo.server(int) SELECT Ricscontent.ID, Ricscontent.PARENTID, Ricscontent.VENDORID, Ricscontent.CONTENTTYPE, Ricscontent.TITLE, Ricscontent.DESCRIPTION, Ricscontent.KEYWORDS, Ricscontent.PREVVERSION, Ricscontent.NEXTVERSION, Ricscontent.SUBMITTEDBY FROM RICSCONTENT Ricscontent WHERE (Id = :0) AND Ricscontent.VENDORID = :1log3:
    log3: QUERY: SELECT Ricscontent.ID, Ricscontent.PARENTID, Ricscontent.VENDORID, Ricscontent.CONTENTTYPE, Ricscontent.TITLE, Ricscontent.DESCRIPTION, Ricscontent.KEYWORDS, Ricscontent.PREVVERSION, Ricscontent.NEXTVERSION, Ricscontent.SUBMITTEDBY FROM RICSCONTENT Ricscontent WHERE (Id = :0) AND Ricscontent.VENDORID = :1
    [170] oracle.jbo(createColumnList) Column count: 17log3:
    [171] jbo.server(int) ViewObject: RicscontentView Query Statement:
    log3:
    [172] jbo.server(int) SELECT Ricscontent.ID, Ricscontent.PARENTID, Ricscontent.VENDORID, Ricscontent.CONTENTTYPE, Ricscontent.TITLE, Ricscontent.DESCRIPTION, Ricscontent.KEYWORDS, Ricscontent.PREVVERSION, Ricscontent.NEXTVERSION, Ricscontent.SUBMITTEDBY FROM RICSCONTENT Ricscontent WHERE (Id = :0) AND Ricscontent.VENDORID = :1log3:
    [173] executeQuery.java(int) QueryCollection: Created new QUERY statement
    log3:
    [174] lang.Object[],(PreparedStatement) Binding param 1: 14log3:
    [175] lang.Object[],(PreparedStatement) Binding null for 2log3:
    [176] afterRollback.oracle(TransactionEvent) RicsvendorView notify ROLLBACK ... log3:
    [177] oracle.jbo(clearQueryCollectionCache) Clear QueryCollection in cache...log3:
    [178] oracle.jbo(createColumnList) Column count: 12log3:
    [179] jbo.server(int) ViewObject: RicsvendorView Query Statement: log3:
    [180] jbo.server(int) SELECT Ricsvendor.ID, Ricsvendor.VENDORNAME, Ricsvendor.ADDRESS1, Ricsvendor.ADDRESS2, Ricsvendor.CITY, Ricsvendor.STATE, Ricsvendor.COUNTRY, Ricsvendor.ZIP, Ricsvendor.DESCRIPTION, Ricsvendor.KEYWORDS, Ricsvendor.NOTES FROM RICSVENDOR Ricsvendor WHERE (Id = :0)log3:
    [181] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [182] lang.Object[],(PreparedStatement) Binding param 1: 3log3:
    [183] afterRollback.oracle(TransactionEvent) Ricscontent_SysC001369Assoc_RicscontentView notify ROLLBACK ... log3:
    [184] oracle.jbo(clearQueryCollectionCache) Clear QueryCollection in cache...log3:
    [185] oracle.jbo(createColumnList) Column count: 17log3:
    [186] jbo.server(int) ViewObject: Ricscontent_SysC001369Assoc_RicscontentView Query Statement: log3:
    [187] jbo.server(int) SELECT Ricscontent.ID, Ricscontent.PARENTID, Ricscontent.VENDORID, Ricscontent.CONTENTTYPE, Ricscontent.TITLE, Ricscontent.DESCRIPTION, Ricscontent.KEYWORDS, Ricscontent.PREVVERSION, Ricscontent.NEXTVERSION, Ricscontent.SUBMITTEDBY FROM RICSCONTENT Ricscontent WHERE (Ricscontent.VENDORID = :1)log3:
    [188] executeQuery.java(int) QueryCollection: Created new QUERY statementlog3:
    [189] lang.Object[],(PreparedStatement) Binding param 1: 3log3:
    [190] afterRollback.oracle(TransactionEvent) RicscontentView notify ROLLBACK ... log3:
    [191] oracle.jbo(clearQueryCollectionCache) Clear QueryCollection in cache...log3:
    log3: RicscontentView row with Id=14 not found!
    log3: java.lang.RuntimeException: RicscontentView row with Id=14 not found!
    void ricsjsp_html.RICSContent._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)log3:
    void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)log3:
    void oracle.jsp.app.JspApplication.dispatchRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)log3:
    void oracle.jsp.JspServlet.doDispatch(oracle.jsp.app.JspRequestContext)
    log3:
    void oracle.jsp.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)log3:
    void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)log3:
    void oracle.lite.web.JupServlet.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)log3:
    void oracle.lite.web.MimeServletHandler.handle(oracle.lite.web.JupApplication, java.lang.String, int, oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)log3:
    void oracle.lite.web.JupApplication.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)log3:
    void oracle.lite.web.JupAppHandler.handle(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)log3:
    void oracle.lite.web.HTTPServer.include(javax.servlet.ServletRequest, javax.servlet.ServletResponse)log3:
    void oracle.lite.web.HTTPServer.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)log3:
    boolean oracle.lite.web.HTTPServer.handleRequest(oracle.lite.web.JupInputStream, java.io.OutputStream)log3:
    boolean oracle.lite.web.JupServer.handle(oracle.lite.web.JupInputStream, java.io.OutputStream)log3:
    void oracle.lite.web.JupHTTPListener$JupHTTP.run()log3:
    null

    I've discovered that if I call
    ApplicationModule.remove();
    at the end of every JSP page, and I prevent JSPApplicationRegistry.returnAppModuleInstance(); from being called, it works. Obviously this is not a longterm solution.
    null

  • BC4J / ADF Faces: Define ViewCriteria at the Iterator in the PageDef

    Hi!
    Is it possible to set the viewcriteria inside the binding (pageDef) and not on the VO level. I need the criterias only in a special view and not in all the others. If I set the criterias on VO level I have to reset them on leaving a view - this can cause problems, if I use the dialog framework (klick on the cross).
    In the API DCIteratorBinding I've found the method 'getViewCriteria' but I miss the corresponding setter.
    Claus

    repost...

  • How can you add a where clause using "OR" with applied ViewCriteria?

    [JDeveloper 10.1.3 SU4]
    [JHeadstart 10.1.3 build 78]
    I am using JHeadstart, but have a question probably more in the ADF area. On the JHeadstart forum I asked:
    "I am overriding JhsApplicationModule's advancedSearch in order to be able to search in childtables. I created transient attributes, display those in advanced search and in the overridden method I check if any of these are filled by the user and create a where clause like 'EXISTS (SELECT 1 FROM <childtable> WHERE <column in childtable> = <column in EO's table> AND <another column in childtable> LIKE '<value supplied by user>)'. I add this whereclause using ViewObject.setWhereClause.
    So far so good and it works. However, if the user selects 'Result matches any criteria', combining setWhereClause and the normal advancedSearch QueryByExample implementation using ViewCriteriaRow do not provide the desired result, since the ViewCriteria and the setWhereClause are AND-ed together, which is fine if the user selects the (default) "Results match all criteria" (everything is AND-ed) but not the "Result matches any criteria", since then every criterium is OR-ed together, except for the setwhereclause criteria and the set of ViewCriteriaRows, they are AND-ed.
    I looked if I could specify that a WhereClause will be OR-ed to existing applied ViewCriteria, but no luck. Do I have to rewrite also advancedSearch's ViewCriteria implementation and write an entire setWhereClause implementation to be able to "OR" every criterium? Or any other suggestions? Can I look at the entire Where clause and rewrite it (after applyCriteria and setWhereClause are called on the VO)?
    Toine"
    Sandra Muller (JHeadstart Team) told me today: "This sounds like a JDeveloper/ADF issue that is not related to JHeadstart. The question is: how can you add a where clause using "OR" if there are already one or more ViewCriteria applied?
    To simplify the test case, you could create a simple ADF BC test client class in a test Model project without JHeadstart (in the test class, use bc4jclient + Ctrl-Enter), in which you first apply a few ViewCriteriaRows to a View Object and also add a where clause.
    Can you please log a TAR at MetaLink ( http://metalink.oracle.com/ ), or ask this question at the JDeveloper forum at http://otn.oracle.com/discussionforums/jdev.html ? (This what I am doing now ;-))
    Thanks,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting"
    Anyone knowing the answer or am I asking for an enhancement?
    Toine

    Hi,
    Can you SET your whereclause as follows ?
    ('Y' = <isAnd>
    and EXISTS (SELECT 1 FROM <childtable> WHERE <column in childtable> = <column in EO's table> AND <another column in childtable> LIKE '<value supplied by user>))
    OR ('N' = <isAnd>
    AND EXISTS (SELECT 1 FROM <childtable> WHERE <column in childtable> = <column in EO's table> OR <another column in childtable> LIKE '<value supplied by user>))
    )

  • Modfiying SQL in a viewObject in a differenat frame

    I wish to collect information from one frame and display the results of a query in another frame.
    My initial idea was to generate an event when the submit bottom was pressed, modify the SQL in the viewObject in the eventHandler class and then have that viewObject displayed in the results frame.
    Do I put the event in the .uix for the entire page or just in the .uix for the individual frame.
    How do I get the viewObject? Right now it is scoped in the results frame.
    How do I modify the SQL query by appending a where clause?
    I can not find an example in the docs. If there is, please tell me where.
    Regards,
    Bill

    This falls in the the realm of answering my own question, but if the JDeveloper team could say right track / wrong track, I would appreciate it.
    I wish to collect information from one frame and display the results of a query in another frame.
    My initial idea was to generate an event when the submit bottom was pressed, modify the SQL in the viewObject in the eventHandler class and then have that viewObject displayed in the results frame.
    Do I put the event in the .uix for the entire page or just in the .uix for the individual frame.Put the event in same frame(.uix) as the submit button.
    How do I get the viewObject? Right now it is scoped in the results frame.Get the ViewObjecy from the ApplicationModule
    From BC4J API
    findViewObject
    public ViewObject findViewObject(java.lang.String voName)
    Finds the named View Object. The View Object name passed in (voName) may or may not be qualified with the name of the containing Application Module. If it is, the View Object name is said to be an AM-qualified View Object name. If not, the name is said to be an unqualified View Object name.
    How do I modify the SQL query by appending a where clause?Use the method setWhereClause in the ViewObject class
    From BC4J API
    setWhereClause
    public void setWhereClause(java.lang.String cond)
    Sets a WHERE clause bind value of the View Object's query statement.
    I can not find an example in the docs. If there is, please tell me where.I could not find an example in the docs for getting a ViewObject from the ApplicationModule, but I found one for
    Creating and Changing View Object Queries in Code
    Once again this is what I found and have not tested it yet. I believe it will work, but comments from the JDeveloper team would be appreciated.
    Regards,
    Bill

  • Problem with lovs in viewobject instances

    Hi,
    Working with Jdev11.1.1.16 ,
    Referring to  forum : Problem with Two VO's from same EO with different where clause
    I was also facing the same issue with static where condition ,using this recommended approach the issue is solved .
    The recommended approach is working fine for fetching data .
    I have create one viewObject with two viewcriteria and created two instances of viewobject in datamodel . In datamodel i have added viewcriteria too.
    But in my case, i need to populate different lovs on same attributes on both the tables (instances of same view object).
    I have added two lovs to the attribute and switch condition based on other attribute.
    While fetching, the data is coming correct and lovs are also correct but while clicking on createinsert lovs are not cuming properly .

    Hi,
    I would suggest that you post relevant pieces of code here - so that it is easier to help you.
    Just a thought:
    Please note that the event handlers may be called again while you are processing another event (there are at least some cases when this is happeneing) - this might lead to "confusing" forms.
    Regards,
    Frank

  • Calling a stored procedure from within a ViewObject

    Is it possible to make stored procedure call from within a BC4J ViewObject? Basically something like this:
    select * from table(f1(3)); where f1 is a table function. Using Oracle's pipelined table functions?
    If not, is it possible to call a stored procedure from Java and have the returned results be put back into a BC4J RowSet.
    In addition, is there a way to create a JDBC Resultset from a BC4J RowSet?
    We need to be able to dynamically create our SQL statements (the entire SQL, not just the where clause) but are required to have these sql statements generated/executed from within a pl/sql stored procedure in the database.

    Is it possible to make stored procedure call from within a BC4J ViewObject? Basically something like this:
    select * from table(f1(3)); where f1 is a table function. Using Oracle's pipelined table functions?
    Yes. Using our expert-mode query feature this is possible.
    is it possible to call a stored procedure from Java and have the returned results be put back into a BC4J RowSet.
    Yes. See this article about basing a view object on a REF CURSOR:
    http://radio.weblogs.com/0118231/2003/03/03.html
    In addition, is there a way to create a JDBC Resultset from a BC4J RowSet?
    No. Not directly. What's the business requirement here so I can understand better?
    We need to be able to dynamically create our SQL statements (the entire SQL, not just the where clause) but are required to have these sql statements generated/executed from within a pl/sql stored procedure in the database.
    REF CURSOR would work fine, or if it's just the statement that needs to be generated dynamically, you could fetch the text of the SQL statement from the stored procedure, then use createViewObjectFromQueryStmt(). Although this has runtime overhead involved with describing the query.
    The REF CURSOR based approach is probably best for this.

  • Web Service/XML-RPC:  SMTP to BC4J web service bridge ??

    A new business problem just landed on my desk for a possible solution.
    One way XML documents coming in from a Novel mail server doing SMTP forward to something
    in the OC4J, BC4J, side to receive and parse the XML.
    It would be great of course if the JDev / OC4J web services tools had a SMTP service
    that would route inbound SMTP messages at email address to a particular Servlet.post().
    Any other ideas??
    Thanks much,
    curt

    I don't have answer for the SMTP binding as currently the Oracle9iAS J2EE Web Services engine doesn't support an SMTP binding (checking with product management to see if their is any solution today). I suspect this is a manual exercise parsing the SMTP message and extracting the SOAP message.
    However with BC4J you do get in Oracle9i JDeveloper 9.0.2 the ability to consume/publish SOAP messages. And the readXML and writeXML methods on the BC4J view objects help deal with the content of your SOAP messages. So some of the work has been done for you.
    If you haven't seen this already, here is what the publishing side looks like. First, if you build a remote method in your <applicationModule>impl.java file with a signature like (everything in "<xxx>" is specific to your implementation), you can publish it as a Web service. For example:
    import org.w3c.dom.*;
    import oracle.xml.parser.v2.*;
    public org.w3c.dom.Element getBC4JXMLDocument (String parm) {
    get<some BC4J view>().setWhereClause("<some column from your BC4J view>" = parm);
    // Assuming your column is a String :-)
    get<some BC4J view>().setWhereClauseParam(0, parm);
    return (Element)get<some BC4J view>().writeXML(1,Row.XML_OPT_ALL_ROWS);
    Then publish the application module method as a Web service (see: http://otn.oracle.com/products/ids/daily/may10.html)
    It is pretty easy to build a client from the WSDL that is generated using the JDev wizards. Once you have the stub your code would look something like:
    import org.w3c.dom.*;
    import oracle.xml.parser.v2.*;
    org.w3c.dom.Element x = stub.getBC4JXMLDocument("your_parameter");
    XSLProcessor l_processor = new XSLProcessor();
    XSLStylesheet l_xsl = l_processor.newXSLStylesheet(this.getClass().getClassLoader().getResourceAsStream("some.xsl"));
    l_processor.showWarnings(true);
    l_processor.setErrorStream(System.err);
    DocumentFragment l_result = l_processor.processXSL(l_xsl,(XMLElement)e);
    // now feed the transformed XML document into the receiving BC4J view object using the readXML method
    The neat thing, which I think is the gist of your message, is that you could then use the BC4J readXML message to parse the incoming XML message and inflate it back into a BC4J view object. The net result would be moving an entire dataset over SOAP to a BC4J client.
    The SMTP binding would have to worked into the stub code generated. I don't have sample code that would help here right now but will check around.
    Mike.

  • 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

  • OAF, View object used with the clausule setWhereClause, show the error  not have been properly initialized.

    Hi to all,
    I'm new with oaf and in mi AM i have to VO that I use to find relative information to the one is shown to the user on a query region, after the user pressed the go buton  the CO request the AM tho load both VO and those information are used to show in a popup region to display and update. the main problem is when the popup region closes it send a submit to the server an the error "View object may not have been properly initialized during Update." is displayed
    The main page and the popup uses the same AM, the initM2mVo() and initTavleVo() are  called by the CO at the processRequest of the main PG, the popup dosen´t have a CO.
    This the AM that uses the main PG and the popup region
    package tasc.oracle.apps.tasc.m2m.imei.server;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.apps.fnd.framework.server.OAViewObjectImpl;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    public class ActualizarImeiAMImpl extends OAApplicationModuleImpl {
        /**This is the default constructor (do not remove)
        public ActualizarImeiAMImpl() {
        /*******************************USE FOR CUSTOM CODE****************************/
         * Inicializa el vo a través del cual se ejecutara la actualización del IMEI.
         * @param taskNumber
        public void loadImeiVo(String taskNumber) {
            OAViewObject voTableQry = getTableQryVO1();
            if (voTableQry != null) {
                voTableQry.reset();
                voTableQry.setWhereClause(null);
                voTableQry.setWhereClauseParams(null);
                voTableQry.setWhereClause("TASK_NUMBER = :1");
                voTableQry.setWhereClauseParam(0, taskNumber);
                voTableQry.executeQuery();
                if (voTableQry.hasNext()) {
                    voTableQry.next();
                    String idActuacion =
                        (String)voTableQry.getCurrentRow().getAttribute("IdActuacion");
                    String dsM2m =
                        (String)voTableQry.getCurrentRow().getAttribute("DsM2m");
                    String imei =
                        (String)voTableQry.getCurrentRow().getAttribute("Imei");
                    if (idActuacion != null) {
                        OAViewObjectImpl m2mVo = (OAViewObjectImpl)this.getTascTransEqInstM2mVO1();
                        m2mVo.reset();
                        if (!m2mVo.isPreparedForExecution()) {
                            m2mVo.setMaxFetchSize(0);
                            m2mVo.executeQuery();
                        m2mVo.setWhereClause(null);
                        m2mVo.setWhereClauseParams(null);
                        m2mVo.setWhereClause("ID_ACTUACION = :1 AND DS_M2M = :2 AND IMEI = :3 ");
                        m2mVo.setWhereClauseParam(0, idActuacion);
                        m2mVo.setWhereClauseParam(1, dsM2m);
                        m2mVo.setWhereClauseParam(2, imei);
                        m2mVo.executeQuery();
                        if(m2mVo.hasNext()){
                            m2mVo.next();
         * Carga los valores disponibles de IMEI según el taskNumber al cual pertenezca
         * el  IMEI seleccionado.
        public void loadImeiValuesList(String taskNumber) {
            ViewObject viewobject = this.getImeiListVO1();
            OAViewObject voTableQry = getTableQryVO1();
            if (voTableQry != null && voTableQry.getCurrentRow() != null) {
                String imeiType =
                    (String)voTableQry.getCurrentRow().getAttribute("Attribute17");
                if (viewobject != null & imeiType != null) {
                    viewobject.setWhereClause(null);
                    viewobject.setWhereClauseParams(null);
                    viewobject.setWhereClause("TASK_NUMBER = :1 AND ATTRIBUTE17 = :2");
                    viewobject.setWhereClauseParam(0, taskNumber);
                    viewobject.setWhereClauseParam(1, imeiType);
                    viewobject.executeQuery();
        /*******************************USE FOR CUSTOM CODE****************************/
        /**Container's getter for TableVO1
        public OAViewObjectImpl getTableVO1() {
            return (OAViewObjectImpl)findViewObject("TableVO1");
        /**Sample main for debugging Business Components code using the tester.
        public static void main(String[] args) { /* package name */
            /* Configuration Name */launchTester("tasc.oracle.apps.tasc.m2m.imei.server",
                                                 "ActualizarImeiAMLocal");
        /**Container's getter for TascTransEqInstM2mVO1
        public OAViewObjectImpl getTascTransEqInstM2mVO1() {
            return (OAViewObjectImpl)findViewObject("TascTransEqInstM2mVO1");
        /**Container's getter for ImeiListVO1
        public OAViewObjectImpl getImeiListVO1() {
            return (OAViewObjectImpl)findViewObject("ImeiListVO1");
        /**Container's getter for TableQryVO1
        public OAViewObjectImpl getTableQryVO1() {
            return (OAViewObjectImpl)findViewObject("TableQryVO1");
    this is the CO of the main PG
    /*===========================================================================+
    |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
    |                         All rights reserved.                              |
    +===========================================================================+
    |  HISTORY                                                                  |
    +===========================================================================*/
    package tasc.oracle.apps.tasc.m2m.imei.webui;
    import java.io.Serializable;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.layout.OAQueryBean;
    * Controller for ...
    public class ActualizarImeiCO extends OAControllerImpl {
        public static final String RCS_ID = "$Header$";
        public static final boolean RCS_ID_RECORDED =
            VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
         * Layout and page setup logic for a region.
         * @param pageContext the current OA page context
         * @param webBean the web bean corresponding to the region
        public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
            super.processRequest(pageContext, webBean);
            //get the handle to AM Attached to our Simple Page Region MainRegionRN
            //The page is passed as parameter to this method, hence we can get handle
            //to the AM quite easily
            OAApplicationModule am = pageContext.getApplicationModule(webBean);
            //verifica si la transaccion de creacion esta activa todavia
            if (TransactionUnitHelper.isTransactionUnitInProgress(pageContext,"ActualizarImeiM2m", false))
                // deshace cambios y finaliza Txn
                am.invokeMethod("rollback");
                TransactionUnitHelper.endTransactionUnit(pageContext, "ActualizarImeiM2m");
         * Procedure to handle form submissions for form elements in
         * a region.
         * @param pageContext the current OA page context
         * @param webBean the web bean corresponding to the region
        public void processFormRequest(OAPageContext pageContext,
                                       OAWebBean webBean) {
            super.processFormRequest(pageContext, webBean);
            //get the handle to AM Attached to our Simple Page Region MainRegionRN
            //The page is passed as parameter to this method, hence we can get handle
            //to the AM quite easily
            OAApplicationModule am = pageContext.getApplicationModule(webBean);
            //Detección del botón go de la región de query.
            this.queryButonGO(pageContext, webBean, am);
            this.updateImei(pageContext, am);
         * Detección del botón go de la región de query
         * @param pageContext
         * @param webBean
         * @param am
        public void queryButonGO(OAPageContext pageContext, OAWebBean webBean,
                                 OAApplicationModule am) {
            OAQueryBean queryBean =
                (OAQueryBean)webBean.findIndexedChildRecursive("QueryRN");
            String idGo = queryBean.getGoButtonName();
            if (pageContext.getParameter(idGo) != null) {
                String tareaId = pageContext.getParameter("TaskNumberLovInput");
                //Inicializa el vo a través del cual se ejecutara la actualización del IMEI.
                Serializable[] parameters2 = { tareaId };
                Class[] paramTypes2 = { String.class };
                am.invokeMethod("loadImeiVo", parameters2, paramTypes2);
                //Carga los valores disponibles de IMEI según el taskNumber al cual pertenezca  el  IMEI seleccionado.
                Serializable[] parameters = { tareaId };
                Class[] paramTypes = { String.class };
                am.invokeMethod("loadImeiValuesList", parameters, paramTypes);
        public void updateImei(OAPageContext pageContext, OAApplicationModule am){
            if (pageContext.getParameter("ActualizarImei") != null){
                String imei = pageContext.getParameter("ImeiPopup");
                //TODO......
    thanks to all.

    I thing I got the problem.
    I have the following configuration:
    One Main Page and external RN that is call as popup in main page
    2 VO, queries by java code, one to capture some information that is used to query the 2 VO that I use to update information by the popup.
    One AM that is map only in the Main Page. (Initially I had the external RN mapped to same AM as the main PG, but I remove it).
    The solution was remove the mapping of the AM from the external region and in the messageimput of the external region set the View instance and view Attribute manually in this fields (http://screencast.com/t/uDTALEedCh do not use the wizard ) as the one instanced am the AM, so the problem it seem that was that defining an AM to the external region create a new instance, causing that it can not see the information that I load manually in the VO by query it them.
    for this case there is not need to use the next code, because the Rows are load with information by the query in the java code, this only will have to be made when inserting a new row .
        public void initM2mVo(){
            //get a handle to the View Object that we wish to initialize
            OAViewObject vo = (OAViewObject)this.getTascTransEqInstM2mVO1();
            if (!vo.isPreparedForExecution()) {
                vo.setMaxFetchSize(0);
                vo.executeQuery();
            //Create a blank Row
            Row row = vo.createRow();
            //Attach that blank row to the VO. Data will be fed into this row, when the user types into the fields
            vo.insertRow(row);
            //Set the status of the blank row to initialized. This tells OA Framework that record is blank and must not be included in DML
            //Operations until    changes are made to its underlying VO [via screen fields]
            row.setNewRowState(Row.STATUS_INITIALIZED);

  • UIX BC4J Java

    How could I transfer the information from UIX site in my Java class and work it on.
    My Scenario:
    Each employee works in a departmebt.
    Now I want to change the department of a employee.
    I show all departments,that I have and I select the current one,
    I would like to select another department and display it by my employee.
    I call method of my class TestSel in UIX in handlers::
    <event name="find" >
    <bc4j:findRootAppModule name="ViewAppModule" >
    <bc4j:findViewObject name="View" >
    <ctrl:method class="bo.TestSel" method="doSel"/>
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>
    </event>
    package bo;
    import...
    public class TestSel {   
    public static EventResult doSel(BajaContext bc, Page page, PageEvent event){   
    ViewObject res = (ViewObject)bc.getProperty("http://xmlns.oracle.com/uix/bc4j", "viewObject");
    Row cur=res.getCurrentRow();
    //Not the selected position, but the last of the site (in range)
    System.out.println("cur"+cur.getAttribute("Id1").toString()) ;
    System.out.println("cur"+cur.getAttribute("FmlyNam").toString()) ;
    if (res.getEstimatedRowCount() != 0)
    RowSetIterator secondRSI = res.createRowSetIterator("secondRSI");
    if (secondRSI.hasNext())
    Row firstRow = secondRSI.first(); //the first row
    System.out.println(firstRow.getAttribute("Id1").toString()) ;
    System.out.println(firstRow.getAttribute("FmlyNam").toString()) ;
    secondRSI.closeRowSetIterator();
    How could I get selected data record here?
    How could I change a value of attributes and apply it in UIX ?
    Help me please!!!
    Inna.

    Would it be easier to use a custom method on the bc4j Application module?
    Take this scenario...
    1. User opens UIX XML web page which opens a bc4j App Module..it has a VO based on all employees.
    2. User presses the add button and a new employee is created (using the bc4j App Module).
    (Notice: no commit yet!)
    3. User presses the submit button...fires event REVIEW_SALARY.
    4. This event is 'handled' in the event section of the UML XML...it calls:-
    public static EventResult handleREVIEW_SALARYEvent (BajaContext context, Page page, PageEvent event)...
    5. I now want to call a java class I wrote that computes an employees new salary and updates the employee record with this new salary. This update will fail unless it is part of the same transaction as the one used by the bc4j App Module (that inserted the new employee).
    How best to proceed from here?
    How about having a method on the bc4j App Mod's VO called 'reviewSalary'? Calling this would use the same transaction? I could then call my java class from within the VO's method? However do I still have the same problem in that my java class expects to be passed the connection object?
    The approach you suggested previously seems a touch dangerous....in that these are not 'publically exposed'...and a new release of JDev may break my code.
    Thanks,
    Paul.

  • BC4J results are not returned

    When I'm trying to go to the last record of a BC4J viewObject this is the output I get in the console.
    insert** id=66, parid=-3, collid=0, keyArr.len=1, cont.len=705
    [544] stmt: begin insert into "PS_STBC4JModule" values (:1, :2, :3, empty_blob(), empty_blob()) returning content, keycont into :4, :5; end;
    [545] stmt: update "PS_STBC4JModule" set content=:1, keycont=:2 where collid=:3 and id=:4
    [546] stmt: delete "PS_STBC4JModule_ky" where collid=:1 and id=:2
    [547] stmt: insert into "PS_STBC4JModule_ky" values (:1, :2, :3, :4)
    [548] **insert** id=67, parid=-3, collid=0, keyArr.len=1, cont.len=705
    [549] stmt: begin insert into "PS_STBC4JModule" values (:1, :2, :3, empty_blob(), empty_blob()) returning content, keycont into :4, :5; end;
    [550] stmt: update "PS_STBC4JModule" set content=:1, keycont=:2 where collid=:3 and id=:4
    [551] stmt: delete "PS_STBC4JModule_ky" where collid=:1 and id=:2
    [552] stmt: insert into "PS_STBC4JModule_ky" values (:1, :2, :3, :4)
    [553] **insert** id=68, parid=-3, collid=0, keyArr.len=1, cont.len=705
    [554] stmt: begin insert into "PS_STBC4JModule" values (:1, :2, :3, empty_blob(), empty_blob()) returning content, keycont into :4, :5; end;
    [555] stmt: update "PS_STBC4JModule" set content=:1, keycont=:2 where collid=:3 and id=:4
    [556] stmt: delete "PS_STBC4JModule_ky" where collid=:1 and id=:2
    [557] stmt: insert into "PS_STBC4JModule_ky" values (:1, :2, :3, :4)
    [558] **insert** id=69, parid=-3, collid=0, keyArr.len=1, cont.len=705
    [559] stmt: begin insert into "PS_STBC4JModule" values (:1, :2, :3, empty_blob(), empty_blob()) returning content, keycont into :4, :5; end;
    [560] stmt: update "PS_STBC4JModule" set content=:1, keycont=:2 where collid=:3 and id=:4
    [561] stmt: delete "PS_STBC4JModule_ky" where collid=:1 and id=:2
    [562] stmt: insert into "PS_STBC4JModule_ky" values (:1, :2, :3, :4)
    [563] **insert** id=70, parid=-3, collid=0, keyArr.len=1, cont.len=705
    [564] stmt: begin insert into "PS_STBC4JModule" values (:1, :2, :3, empty_blob(), empty_blob()) returning content, keycont into :4, :5; end;
    [565] stmt: update "PS_STBC4JModule" set content=:1, keycont=:2 where collid=:3 and id=:4
    [566] stmt: delete "PS_STBC4JModule_ky" where collid=:1 and id=:2
    [567] stmt: insert into "PS_STBC4JModule_ky" values (:1, :2, :3, :4)
    [568] **insert** id=-3, parid=-2, collid=0, keyArr.len=-1, cont.len=1449
    [569] stmt: begin insert into "PS_STBC4JModule" values (:1, :2, :3, empty_blob(), null) returning content into :4; end;
    [570] stmt: update "PS_STBC4JModule" set content=:1 where collid=:2 and id=:3
    [571] stmt: delete "PS_STBC4JModule_ky" where collid=:1 and id=:2
    [572] stmt: insert into "PS_STBC4JModule_ky" values (:1, :2, :3, :4)
    [573] **insert** id=71, parid=-4, collid=0, keyArr.len=1, cont.len=705
    [574] stmt: begin insert into "PS_STBC4JModule" values (:1, :2, :3, empty_blob(), empty_blob()) returning content, keycont into :4, :5; end;
    [575] stmt: update "PS_STBC4JModule" set content=:1, keycont=:2 wher
    It seems the application is trying to return all of the rows, when I only want it to return the last row. Please help this is an urgent matter.
    Jeff

    Jeff:
    You're getting these passivation messages because you have a lot of rows in your RowSet, and you're trying to locate the last row. In this case, yes it will try to traverse all rows until it reaches the end.
    Further if you have a lot of rows, we will start spilling rows into database, thus producing these messages on PS_ tables.
    There are a few different ways to avoid this.
    1. Usually, if you need to locate the last row quickly, you should specify an order-by clause to do descending sort (or something like that) so that you can locate the desired row quickly.
    2. Or, you can adjust where-clause to reduce the number of rows.
    3. If you want to turn off spill-to-disk (so that you avoid DML interactions with PS_ tables), you can do that through configuration. Please take a look at
    http://otn.oracle.com/products/jdev/htdocs/bc4j/bc4j_temp_tables.html
    Thanks.
    Sung

  • Shuttle component and BC4J

    Hi,
    Im looking for any information re using the Shuttle component together with BC4J:
    Is it possible to populate the Leading and Trailing lists of a UIX Shuttle component with data from a BC4J viewObject?
    Thanks, Jan

    Oh, some sample code:
    <shuttle name="shuttle1" leadingHeader="Available"
    shortDesc="sddsd" trailingHeader="Assigned"
    size="10" reorderable="false">
    <leading>
    <list>
    <contents>
    <bc4j:optionList voName="TscrRoleCodeView1"
    attrName="RceRoleId"
    textAttrName="RceRoleDesc"/>
    </contents>
    </list>
    </leading>
    This only gives the 1st value in the View list...

Maybe you are looking for