BC4J Logon bug

Hello,
I think I found a bug in the BC4J logon mechanism:
When creating the root application module I'm providing
my own EnvInfoProvider that uses a custom dialog to retrieve dinamically the user and password.
Now, let's presume that either the user or the password is given an invalid value at the first invocation of envInfoProvider.getInfo(); the logon will fail and getInfo() will be called again; this time the user and the password are correct and the database logon will succeed.
And now the problem: if at a latter moment I'm requesting
applicationModule.getSession().getEnvironment(), the returned hash table contains the invalid user name and password as provided by the first invocation of envInfoProvider.getInfo().
Please try to reproduce and let me know if it can be solved...
Thanks,
Dan

Hi,
getInfo() is intended to provide a hook for specifying initial ApplicationModule context and custom JDBC properties. It is not intended to be a hook for modifying the ApplicationModule session environment.
The fact that the connection information appears in the AM session environment at all is the result of an implementation detail.
If you need information about the current JDBC connection then you could:
1. Query oracle.jbo.Transaction.getConnectionMetadata
2. Query the DB for the current user
3. Extend DBTransactionImpl to expose the underlying JDBC connection and then query the Connection DatabaseMetaData for the database user
All three of these techniques could be employed from oracle.jbo.server.ApplicationModuleImpl.prepareSession(Session) and the results could then be used to properly initialize the AM session environment. This will guarantee that the session environment is always in synch with the connection.
Hope this helps,
JR

Similar Messages

  • BC4J - update bug

    Hi,
    I have the following view query :
    SELECT Citiri.ID,
    Citiri.LOCM_ID,
    Citiri.PERD_ID,
    TO_CHAR(PerioadeDecontare.data_inceput, 'dd.mm.yyyy') || ' - ' || TO_CHAR(PerioadeDecontare.data_sfirsit, 'dd.mm.yyyy')|| ' anterior ' ||
    TO_CHAR(v.data_inceput, 'dd.mm.yyyy') || ' - ' || TO_CHAR(v.data_sfirsit, 'dd.mm.yyyy') Perioada
    FROM CITIRI Citiri, PERIOADE_DECONTARE PerioadeDecontare, PERIOADE_DECONTARE v
    WHERE
    Citiri.PERD_ID =PerioadeDecontare.ID (+) and PerioadeDecontare.PER_ANTER_ID = v.ID (+)
    As you can see "Perioda" (duration) is a computed field
    and if I change the Citiri.PERD_ID it should be recomputed
    but this dosn't happen in BC4J.
    And another case is when I put the computed field in a separate view View1 (in database) and try to create a view based on a entity create from View1.
    So I have : View2 - Citiri - entity
    - View1 - entity
    and the Query of View2 :
    SELECT Citiri.ID,
    Citiri.LOCM_ID,
    Citiri.PERD_ID,
    View1.ID,
    View1.Perioada
    FROM CITIRI Citiri, View1 View1
    WHERE
    Citiri.PERD_ID =View1.ID (+)
    The same problem : the Perioada -field doesn't get updated when I change Citiri.PERD_ID
    regards,
    Lucian.

    Okay, try this. In your ViewObjectRowImpl.java file (if one doesn't exist, you can get it by checking all the boxes on the Java tab of the view object dialog), override the get method for the attribute in question. Assuming that your method is like this:
    public String getPerioada() {
    return (String)getAttributeInternal(PERIODA);
    Change it to be like:
    public String getPerioada() {
    DateFormat df = new SimpleDateFormat ("dd.mm.yyyy");
    String outString = df.format(getDataInceput.dateValue());
    String outString += "-";
    String outString +=df.format(getDataSfirsit.dateValue());
    String outString +=" anterior ";
    String outString +=df.format(getDataInceput.dateValue());
    String outString +="-";
    String outString += df.format(getDataSfirsit.dateValue());
    return outString
    Notes:
    1) You will need these imports:
    java.text.SimpleDateFormat
    java.text.DateFormat
    2) This assumes that you have created columns in the underlying entities that are used in the calculations and included them in the view object.

  • BC4J bug with "bind variables" JBO-27122 ORA-01008

    I think we are found a BUG using BC4J with bind variables in a view object.
    If the bind variable appear in the WHERE condition two or more times at
    the beginning of the query the above error occur.
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement:
    SELECT Emp.EMPNO,Emp.ENAME,Emp.JOB,Emp.MGR,Emp.HIREDATE,Emp.SAL,Emp.COMM, Emp.DEPTNO
    FROM SCOTT.EMP Emp
    WHERE :1 <=10000 and :1 <= sal and :2=20
    java.sql.SQLException: ORA-01008: not all variables bound
    Otherwise if bind variable apper two or more times, but not together
    like this sample:
    WHERE :1 <=10000 and :2=20 and :1 <= sal
    the error not occur.
    We prove this with:
    JDeveloper 9.0.5.2 (build 1618)Business Components Version 9.0.5.16.0
    JDeveloper 9.0.5.0 (build 1375)Business Components Version 9.0.5.13.52
    I looking for a patch! or acceptable workaround.
    Tx for your help!
    diego.
    /* the cliente app */
    ApplicationModule am = Configuration.createRootApplicationModule("business_tier.AppModule","AppModuleLocal");
    ViewObject vo = am.findViewObject("EmpView");
    vo.setWhereClauseParam(0,"100");
    vo.setWhereClauseParam(1,"20");
    Row emp = vo.first();

    This is a known bug (1326006). The workaround is to use:
    vo.setWhereClauseParam(0,"100");
    vo.setWhereClauseParam(1,"20");
    vo.setWhereClauseParam(2,"20");
    Hope this helps,
    Lynn
    Java Tools Team

  • Bug? InfoView SP4 logon using ivsLogonToken and start.do

    Greetings to the forum.
    We have developed a custom login page for accessing InfoView using the StartAction (start.do) IEnterpriseSession's logon tokens via ivsLogonToken parameters. Everything has worked quite nicely until we started functional tests with BOEXIr2 SP4. It looks like there is a new cookie key LOGOFF_TOKEN with value '1' being created during the LogoffAction. We assume this cookie is being used to prevent the users from using their browsers back button to access the InfoView. Our problem is that this value also seems to prevent access to the site for later logins as well when using the StartAction. Deleting the cookie manually does grant access normally.
    This issue was found at least with Firefox browser.
    BO has provided some official documentation for using the StartAction (e.g. inhttps://boc.sdn.sap.com/files/javaXI30.ppt). I have been trying to find some other sources for custom logins. Is there any documents provided by BO?
    Now is there anyone following this forum who could confirm this being a bug (and tell me how to properly report this), and does BusinessObjects confirm that using the StartAction is officially supported (but IMHO poorly documented) feature?

    Hello Pasi,
    The Service Pack 4 behavior appears to be a consequence of handling page caching issues with newer Firefox browsers - the tracking number is ADAPT00794449.
    The best way to have SAP Business Objects have a look at your issue would be to open a support case - a SAP Incident.  Since you have Enterprise, it's very likely someone in your organization would have a support contract.
    Sincerely,
    Ted Ueda

  • BC4J/Jedeveloper 3.2 BUG with SetAttribute on LONG RAW

    Hi,
    I'm using Jdeveloper 3.2, a BC4J/JSP application and a Oracle Thin connection to Oracle 8.0.4.
    I think I found a bug in BC4J:
    I have a table with a LONG RAW column that is also used by other (non BC4J)
    applications to store binary data (including, but not limited to JPG's)
    I'm able to retrieve data of any size using GetAttribute().
    When I use the following code from a WebBean, it fails on commit
    when the file is bigger than 4K.
    The error is:
    Error Message: JBO-26041: Failed to post data to database during "Update":
    SQL Statement " UPDATE BDATA Bdata SET LRDATA=:1 WHERE ID_CARD=:2 AND CODE_REGISTRATION=:3".
    Error Message: ORA-01461: can bind a LONG value only for insert into a LONG column
    public void setData(java.io.File f) throws Exception
    long len = f.length();
    InputStream in = new FileInputStream(f);
    Row myRow = qView.getCurrentRow();
    byte[] buffer = new byte[(int)len];
    in.read(buffer, 0, (int) len);
    in.close();
    Raw myval = new Raw(buffer);
    myRow.setAttribute("Lrdata", myval);
    Please help, I need this to work !
    null

    Raw domain is limited to the oracle-JDBC limitations of 4K length for such-streaming data types unless a Stream is used to update the data. We plan to support such streaming for Raw domain in the next major-release.
    However, you should be able to work with Raw domain and if your data size is bigger than 4K, override the doDML() method in EntityImpl (that contains the Raw attribute) and perform a custom update for the Raw data. Basically the logic will be something like:
    doDML()
    1. save the raw attribute value
    2. Populate 'null' or a single byte-bytearray for raw attribute value so that super.doDML() won't fail.
    3. prepare an update statement with just the raw column and where clause for this entity's primary key.
    4. fill in the raw data using an in-memory stream over the bytes from the Raw domain instance held in step 1. Use Statement.setBinaryStream() method.
    5. execute the statement (to post the stream).
    6. re-populate the entity data-structure with the valid Raw domain instance.
    null

  • Bug in BC4J test query while creating view based on query

    In BC4J while creating a view from query if we test our query , BC4J modify the query with the following one :
    "SELECT * FROM ( " + ourQuery + " ) where 1=2;"
    so for the Query like "SELECT ename,ename from emp" which is a valid query it modifies it to
    "SELECT * FROM ( SELECT ename,ename from emp ) where 1=2;"
    which is an invalid Query and BC4J get a SQLException:column ambiguously defined and Test fails
    BC4J does this modification in query because it doesn't want to Fetch Data from Database and add the where clause
    to the query but in Cases like above this modification doesn't work properly.
    one way to solve the problem is by giving alias name to the columns of query.Is there any other way to do the same as my query is completely Valid and i don't want to change it at all ?

    Hi Jan,
    Actually I am getting my query at run time and based on that I am creating a view.This Query can be given by User of my application and at that time it'll be very painful for me to handle that.
    It's definately a Bug in BC4J as they should not modify the query in this way.Thanx for ur interest in my problem.

  • 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 bug in 9.0.3.3

    Hi,
    I've just downloaded Jdev 9.0.3.3 and the very first thing I tried seems to have a bug. I tried to remove an attribute from a BC4J entity using the Entity Object Editor. The first thing it does is lock up for about a minute, then it eventually starts responding again. However, the attribute I deleted still exists so I press the Delete button again - the IDE immediately crashes. Is this a bug -it certainly didn't do this in previous versions of Jdeveloper.
    Steve

    And they said:
    Bug:3120608 DELETING AN ENTITY ATTRIBUTE CAUSES EXCEPTION, THEN CRASHES JDEV,
    this bug is an internal one, filed for version 9.0.5.13.66 and fixed in version 9.0.5.13.67.
    So don't hold your breath!
    Sascha

  • BUG: Can't create BC4J Application Module Configurations

    Hello,
    I'm using JDev 9.0.3.1 with Win2K and WinXP. There seems to be a bug in the BC4J Application Module Configuration Manager:
    It seems to be impossible to create a new BC4J Application Module Configuration with the Configuration Manager of a BC4J Application Module. I can copy an existing AM configuration, but I can not rename it. Clicking on the OK Button in the Configuration Manager simply does nothing.
    A work around seems to be to open bc4j.xcfg in any text editor, copy an AppModuleConfig element, save xcfg, in JDev remove the project form the workspace, readd it to the workspace (some caching issue of jdev?). Then the new AM config is there and can be modified.
    In JDev 9.0.3 the Config Manager seems to work fine.
    Regards
    Stefan

    The bug is mentioned in metalink bug 2849146.

  • BC4J /  JDBC Failover BUG ?

    I have developed an ADF / BC4J application which works.
    In our environment we have a failover configuration
    I coded this approach for my ADF applications.
    My Custom connect string in the connection wizard for the BC4J is:
    jdbc:oracle:thin:@
    (DESCRIPTION =
         (ADDRESS = (PROTOCOL = TCP) (HOST =aaa.bbb.yyy.zzz)(PORT = 1521))
         (ADDRESS = (PROTOCOL = TCP) (HOST =bbb.bbb.yyy.zzz)(PORT = 1521))
         (LOAD_BALANCE = yes)
         (CONNECT_DATA =
              (SERVER = DEDICATED)
              (SERVICE_NAME = db.yyy.zzz)
              (FAILOVER_MODE = (TYPE = SESSION) (METHOD = BASIC) (RETRIES = 180) (DELAY = 5))
    When I press test connection it works and says success. (The first host in the list is actually down and we are using the failover host.)
    However when I deploy the app to the OC4J Standalone Middle Tier (10.1.3.0) and then attempt to run the app I get the following error in the browser:
    JBO-30003: The application pool (zzz.yyy.bbb.CustSubDivsAppLocal) failed to checkout an application module due to the following exception:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.DMLException, msg=JBO-26061: Error while opening JDBC connection.
    If I remove the unavailable host (the first one) from the ADDRESS list the application works properly. If I change the order of the hosts so the first one is the one thats up it also seems to work ok.
    It seems that the OC4J middle tier cannot handle the fact that the first host in the list is down and throws an exception instead of trying the second one. In JDeveloper BC4J Connection Wizard it seems to handle the down host properly.
    Is this correct or have I setup the URL incorrectly ?
    This has caused a huge headache for me as we are currently running on our failover hosts due to SAN maintenance and all my J2EE apps stopped working !!
    Thanx
    Andrew

    Hi Hans,
    A JDev developer, John S., recently created a bug report that if I remember
    correctly, said that creatRoot... was not thread safe.
    My scenario that caused this discovery (functionally identical to your looping threads cases)
    was multple concurrent requests created by rapid clicking a submit button. This creates multple threads in the web tier
    dispatching against a BC4J component calling createRoot....
    in our JSP/Servlets. Just like your code, Hans.
    The end result was some ugly exceptions and failed use cases of the 2nd or so to Nth threads.
    In short, I believe that your design won't work.
    I could work if you gave each thread a separate identity, via a separate BC4J cookie, thus simulating separate BC4J sessions.
    I'm not at all familiar with this area of the BC4J API, just know general buzz words to be dangerous and confusing
    to you. ;-(
    Hopefully John S. will jump in here and help you.
    Good luck, Curt.
    PS please post your solutions?

  • BC4J+UIX:Is it a bug?

    There is a strange problem:
    I use a null event to init a vo,as following:
    <?xml version="1.0" encoding="GBK"?>
    <page xmlns="http://xmlns.oracle.com/uix/controller"
    xmlns:ui="http://xmlns.oracle.com/uix/ui"
    xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
    xmlns:html="http://www.w3.org/TR/REC-html40"
    xmlns:bc4j="http://xmlns.oracle.com/uix/bc4j">
    <bc4j:registryDef>
    <bc4j:rootAppModuleDef name="VTbReceiveListView1AppModule"
    definition="Project.PropakModule"
    releaseMode="stateful">
    <bc4j:viewObjectDef name="VTbReceiveListView1" rangeSize="20" />
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    <content>
    <event name="null">
    <bc4j:findRootAppModule name="VTbReceiveListView1AppModule">
    <method class="propackage.ReceiveListAffirm" method="initReceiveList"/>
    </bc4j:findRootAppModule>
    </event>
    and the event is :
    public static EventResult initReceiveList(
    BajaContext context,
    Page page,
    PageEvent event) throws Throwable
    String sWhere="";
    double dAmountGross=0,dAmountVat=0,dAmount=0;
    ApplicationModule amThis = ServletBindingUtils.getApplicationModule(context);
    HttpSession session = context.getServletRequest().getSession(true);
    sWhere = "VALIDATED_MARK = 'N' AND "+ session.getAttribute("GuoSessionWhere").toString();
    voThis.setWhereClause(sWhere);
    voThis.executeQuery();
    int length = voThis.getFetchedRowCount();
    EventResult result = new EventResult(page);
    return result;
    the value of length is 0 when i first run the page.
    However,when i refresh(F5) this page,it is 9(the right number).
    Who can tell me the reason?

    This post is the same as the post on the JDeveloper forum at:
    UIX+BC4J BUG: Is it a bug?
    Please keep all followups to the other thread.
    -brian
    Team UIX
    PS: Please do not post the same question to the JDev and UIX forums, as they are monitored by the same people.

  • Bc4j bug at refresh after insert / update

    having a table and a trigger on it that fills an attribute
    in a 9i db. one can take the scott/tiger emp table and use the
    following trigger:
    create or replace trigger t_bri_emp
    before insert on emp
    for each row
    declare
    v_no number(7,2);
    begin
    select user_SEQ.nextval*100
    into v_no
         from dual;
    :new.sal := v_no;
    end;
    then creating a bc4j project with an entity object based on this table (emp)
    and a view object based on the created entity object.
    !!!! when you create the bc4j project you must set the SQL Flavor to SQL92 or OLite
    when you set the attribute settings, for the attribute the trigger is on (sal),
    to refresh after insert / update or both in the entity object you get a
    null pointer when you try to insert a new row and commit.
    java.lang.NullPointerException
         oracle.jdbc.ttc7.TTIoac oracle.jdbc.ttc7.TTCAdapter.newTTCType(oracle.jdbc.dbaccess.DBType)
         oracle.jdbc.ttc7.NonPlsqlTTCColumn[] oracle ....................
    all can be reproduced just useing the wizard and start the bc4j project with the tester
    any workaround ??

    Sven:
    I looked into your issue. It turns out your problem is caused by a bug in the system (bug #2409955).
    The bug is that for non-Oracle SQLBuilder, we are not processing refresh-on-insert and refresh-on-update attributes correctly. We end up forming an invalid SQL statement and the JDBC driver gives the obscure NullPointerException.
    Thus, until 9.0.3, you should not use refresh-on-insert/update attributes on a non-Oracle SQLBuilder.
    If you need the refresh-on-insert/update attribute, here is a possible workaround:
    1. Whenever you invoke the tester, on the first panel, click on the 'Properities' tab. In the list of properties, you should find one for 'jbo.SQLBuilder'. It will say 'SQL92'. Remove it, so that it is empty. Run test tester. Then, the tester will use Oracle SQLBuilder which will handle refresh-on-insert/update attributes correctly for you.
    2. For switching between Oracle SQLBuilder and SQL92 SQLBuilder, you can try the following:
    2a) Locate bc4j.xcfg and your Project??.jpx under your 'src' directory.
    2b) Make copies of these files.
    2c) Edit them so that you have one set for Oracle SQLBuilder and one set for SQL92 SQLBuilder. For Oracle SQLBuilder, make sure these files do NOT have entries like:
    <jbo.SQLBuilder>..</jbo.SQLBuilder> in bc4j.xcfg and
    <Attr Name="_jbo.SQLBuilder" Value="..." /> in Project??.jpx
    When there is no jbo.SQLBuilder entry, BC4J will default to Oracle.
    For SQL92, make sure you have
    <jbo.SQLBuilder>SQL92</jbo.SQLBuilder> in bc4j.xcfg and
    <Attr Name="_jbo.SQLBuilder" Value="SQL92" /> in Project??.jpx.
    Before you run, decide which SQLBuilder to use (for 9.0.2, with retrieve-on-insert/update attrs, you have no choice but to use Oracle SQLBuilder) and copy these files into your class path, e.g.,
    <jdev-install-dir>\jdev\mywork\Workspace1\Project1\classes
    When you get 9.0.3, then you should be able to switch between Oracle and SQL92 SQLBuilders freely.
    Thanks.
    Sung

  • UIX Bug - bc4j:setAttribute

    The context:
    We have a UIX form used to edit a view row. The 'save' event is executing a chain of bc4j:setAttribute events.
    The bug:
    The row contains an attribute having a null value. The corresponding text field into the form remains unchanged (empty). This means that on submit, the browser sends to the server a 'null' value. Unexpectedly, the setAttribute method for this attribute is invoked for the current ViewRowImpl. Since the value of the attribute is not changed, I am expecting a different behavior i.e. not invoking this method.
    thanks

    Hi,
    This is a bug, which has been filed.
    Thanks,
    Gabrielle

  • UIX XML-BC4J: Bug on messageTextInput

    We have found a bug on the BC4J:messageTextInput tag because it doesn't use the value of "prompt" attribute to generate client validating messages.
    Message alerts displayed on browser are on the following form:
    Form Validation failures: a value must be entered for ''
    PS: this problem did not occur with BC4J:messageInput but we can't use it because it doesn't support the onSubmitValidater inner tag to specify the field type.

    Try explicitly setting the "id" to a unique value; that should fix the problem.
    It is a bug, but one that won't be fixed for 9.0.3.

  • UIX/XML BC4J  Bug on "selectedValue" attribute

    We suspect a bug in tag bc4j:attrProperty when used within boundAttribute because bounding
    it to property selectedIndex works correctly, while bounding it to selectedValue result in a
    Servlet error: Renderer failed: java.lang.ArrayIndexOutOfBoundsException
    Correctly executed code (but logically wrong):
    <bc4j:attrScope name="FlgObsoleto">
    <contents>
         <messageChoice name="FlgObsoleto" prompt="Stato">
              <boundAttribute name="selectedIndex">
                   <bc4j:attrProperty name="value"/>
              </boundAttribute>
              <contents>
                   <option value="2" text="Element 0"/>
                   <option value="0" text="Element 1"/>
                   <option value="34" text="Element 2"/>
              </contents>
         </messageChoice>
    </contents>
    </bc4j:attrScope>
    Code resulting in error (but logically correct):
    <bc4j:attrScope name="FlgObsoleto">
    <contents>
         <messageChoice name="FlgObsoleto" prompt="Stato" >
              <boundAttribute name="selectedValue">
                   <bc4j:attrProperty name="value"/>
              </boundAttribute>
              <contents>
                   <option value="2" text="Element 0"/>
                   <option value="0" text="Element 1"/>
                   <option value="34" text="Element 2"/>
              </contents>
         </messageChoice>
    </contents>
    </bc4j:attrScope>

    The infamous ArrayIndexOutOfBoundsException - argh. This always means
    some other, real exception has happened. In this case, it's a
    ClassCastException as some bad code of ours blindly casted to
    String. This is fixed in 9.0.3. In 9.0.2, there's a clumsy
    workaround to force the attribute type to a string and dodge the bug.
    Change this one instance of:
    <bc4j:attrProperty name="value"/> to:
    <concat>
      <bc4j:attrProperty name="value"/>
      <fixed text=""/>
    </concat>Ugly. Very, very ugly!

Maybe you are looking for

  • Images are not showing in Google Reader for some websites, others are fine

    Some blogs show images in Google Reader, some do not. I can click on the blog subject and go to that blog directly in another tab and I see the images just fine, just not in the reader.

  • Safari Problem with All Numbers Look Strange

    All of the numbers accept for the Apple website look odd. I have taken a screenshot of the issue, but I'm not sure how to post it. The numbers are in individual boxes separated by dashes. Similar to old clocks with the flipping numbers. Software upda

  • Aperture 2 thumbnail quality grainy on imports

    I am migrating to Aperture because it is lightning quick in managing with 1000s of images. I am particularly pleased with how it allows quick access to high-quality thumbnail images of photos in a large project. I should note, that my imports are ref

  • IPod Touch Synching Issue

    I can drag music onto my ipod touch from iTunes on my pc but it wont fully load - greyed out with circular arrow symbol -any ideas what the problem is?

  • Workflow trigger an idoc

    HI How trigger a idoc from a workflow????? Hi idoc trigger from a workflow.please suggest. example like po change.. Edited by: Abhijit Paul on Jun 26, 2009 8:42 AM