Vo.findByKey(..)  BUG

Why can the newly added row not be found but the allready existing ?????
Using the HR user on a 9.2.0.1.0 db with jdev 9.0.3.1035
The example assumes you've created:
1. A package named mypackage3
2. A Departments entity object
3. A DepartmentsView view object with its attributes referencing the Department entity object and the attribute DepartmentName set as Key Attribute in View Object Wizard
4. An application module named Mypackage3Module which references an instance of DepartmentsView
The output should be:
--- found the existing row by 1st key
--- the keys of the row are: oracle.jbo.Key[200 Operations ]
DepartmentId = 200
DepartmentName = Operations
--- found the existing row by 2nd key
--- the keys of the row are: oracle.jbo.Key[200 Operations ]
DepartmentId = 200
DepartmentName = Operations
--- found the newly inserted row by 1st key
--- the keys of the row are: oracle.jbo.Key[4444 AName ]
DepartmentId = 4444
DepartmentName = AName
--- did not find the newly inserted row by 2nd key
Here is the code:
package mypackage3;
import java.util.*;
import javax.naming.*;
import oracle.jbo.*;
import oracle.jbo.domain.Number;
public class FindByKeyClient {
public static void main(String s[]) {
ApplicationModule am = FindByKeyClient.create("mypackage3.Mypackage3Module","jdbc:oracle:thin:hr/[email protected]:1521:HGDB02");
ViewObject departmentsVO = am.findViewObject("DepartmentsView");
//create new row and add to vo
Row newRow = departmentsVO.createRow();
newRow.setAttribute("DepartmentId",new Number(4444));
newRow.setAttribute("DepartmentName","AName");
departmentsVO.insertRow(newRow);
Object[] keyVals;
Row[] result;
// find a existing row
//try to find a row that is not newly inserted by 1st key
keyVals = new Object[1];
keyVals[0] = new Number(200);
result = departmentsVO.findByKey(new Key(keyVals), -1);
FindByKeyClient.showInfo(result, "the existing row by 1st key");
//try to find a row that is not newly inserted by 2nd key
keyVals = new Object[2];
keyVals[1] = "Operations";
result = departmentsVO.findByKey(new Key(keyVals), -1);
FindByKeyClient.showInfo(result, "the existing row by 2nd key");
// do the same but with a new row
//try to find newly inserted row by 1st key
keyVals = new Object[1];
keyVals[0] = new Number(4444);
result = departmentsVO.findByKey(new Key(keyVals), -1);
FindByKeyClient.showInfo(result, "the newly inserted row by 1st key");
//try to find newly inserted row by 2nd
keyVals = new Object[2];
keyVals[1] = "AName";
result = departmentsVO.findByKey(new Key(keyVals), -1);
FindByKeyClient.showInfo(result, "the newly inserted row by 2nd key");
private static void showInfo(Row[] result, String infoTxt) {
if(result.length > 0) {
System.out.println("--- found "+infoTxt);
System.out.println("--- the keys of the row are: "+result[0].getKey());
System.out.println("DepartmentId = "+ result[0].getAttribute("DepartmentId"));
System.out.println("DepartmentName = "+ result[0].getAttribute("DepartmentName")+"\n");
} else {
System.out.println("--- did not find "+infoTxt);
public static ApplicationModule create(String amDefName, String jdbcConnStr) throws ApplicationModuleCreateException {
ApplicationModule am = null;
try {
Hashtable env = new Hashtable(2);
env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
Context ic = new InitialContext(env);
am = ((ApplicationModuleHome)ic.lookup(amDefName)).create();
am.getTransaction().connect(jdbcConnStr);
} catch (javax.naming.NamingException nex) {
throw new ApplicationModuleCreateException(nex);
return am;
}

Sven:
For proper operation of findByKey, the PK of the VO should be a composition of the PKs of the EO(s) that make up the VO. In other words, if a VO is made up of EO1 and EO2, its PK should be (EO1's PK + EO2's PK).
In your case, it seems the VO's PK does not match the EO's PK (VO's PK has an extra attr, DepartmentsName). That is causing the incorrect behavior.
When you issue findByKey, we decompose the incoming key into EO keys. In the above example, where the VO is made up of EO1 and EO2, the key is decomposed into key for EO1 and key for EO2.
Then, we use EO1's key (if it is not null) to look into the entity cache to find the row. This action will find new rows as well as old. If not enough rows are found through this, we go out to database, issuing a SQL statement.
Thus, I would try your test where the VO's PK matches EO's PK. Then,you should see the expected results.
Thanks.
Sung

Similar Messages

  • Problem with ordimage attribute in detail viewobject (a bug maybe?)

    Hi
    JDeveloper: 11.1.1.4
    I have an ordimage attribute in a viewobject among other attributes but it doesnt show the image while it shows other attributes of the viewobject correctly. It throws java.lang.ArrayIndexOutOfBoundsException when executing the "row = rows[0];" instruction in oracle.ord.html.OrdPlayMediaServlet.renderContent() method. Apparently the main reason for this error is that the vo viewobject doesn't get populated correctly (it contains no rows at all) and so the "rows = vo.findByKey(mKey, 1); " doesn't return any rows.
    Isn't this a bug? Is there any workaround to this?
    P.S: When I use another instance of the same viewobject as a master viewobject works just fine. The error occours only when the viewobject is used as a detail viewobject.
    Anyway, here is the exception:
    ]] Root cause of ServletException.
    java.lang.ArrayIndexOutOfBoundsException: 0
         at oracle.ord.html.OrdPlayMediaServlet.renderContent(OrdPlayMediaServlet.java:411)
         at oracle.ord.html.OrdPlayMediaServlet.deliver(OrdPlayMediaServlet.java:264)
         at oracle.ord.html.OrdPlayMediaServlet.doGet(OrdPlayMediaServlet.java:205)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         Truncated. see log file for complete stacktrace
    >
    <06/09/2011 IRDT 07:49:19 م> <Notice> <Diagnostics> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'DefaultServer' has triggered at 06/09/2011 IRDT 07:49:19 م. Notification details:
    WatchRuleType: Log
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
    WatchData: DATE = 06/09/2011 IRDT 07:49:19 م SERVER = DefaultServer MESSAGE = [ServletContext@22121593[app:PPCM module:PPCM-ViewControllerCM-context-root path:/PPCM-ViewControllerCM-context-root spec-version:2.5], request: weblogic.servlet.internal.ServletRequestImpl@c1d6b6[
    GET /PPCM-ViewControllerCM-context-root/ordDeliverMedia?appModID=AppModuleCMDataControl&viewObjectName=AppModuleCM.VpConscriptPictureView1&contentCol=ORD_PICTURE&rowKey=0001000000063332323934330000000C000001323F51EEFD&amConfig=jhs1.model.services.AppModuleCMLocal&cache=1277027229000 HTTP/1.1
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
    Accept: image/png,image/*;q=0.8,*/*;q=0.5
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive
    Referer: http://127.0.0.1:7101/PPCM-ViewControllerCM-context-root/faces/UIShell?_adf.ctrl-state=hjjcdrfdk_4&_afrLoop=40582159673504
    Cookie: JSESSIONID=v23hTmyL7mZ9vmMZSndhG7g1sds8CDSy3rn3bL2XcGLgVTLG6s2V!752893283
    ]] Root cause of ServletException.
    java.lang.ArrayIndexOutOfBoundsException: 0
         at oracle.ord.html.OrdPlayMediaServlet.renderContent(OrdPlayMediaServlet.java:411)
         at oracle.ord.html.OrdPlayMediaServlet.deliver(OrdPlayMediaServlet.java:264)
         at oracle.ord.html.OrdPlayMediaServlet.doGet(OrdPlayMediaServlet.java:205)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101017 MACHINE = PC-SD14-00007 TXID = CONTEXTID = ef583e64d845493d:6a9a6ea3:1323e534a92:-8000-00000000000005b2 TIMESTAMP = 1315322359312
    WatchAlarmType: AutomaticReset
    WatchAlarmResetPeriod: 30000
    >

    I have encountered the same problem.
    JDeveloper 11.1.1.3
    Did you come up with a work-around since September?

  • SetCurrentRow feature or bug?

    When trying to set the current row of a RowSet to a Row that are obtained from the same Rowset (using findByKey) but with a rangeSize smaller than the total number of rows in the row set, the method setCurrentRow(Row) of the RowSet doesn't work:
    ViewObject voLine = am.findViewObject("theVO");
    Row [] rLines = voLine.findByKey(new Key(new Object[]{ Pkval1, Pkval2 }),1);
    // to this point rLines > 0
    voLine.setRangeSize(-1);
    voLine.getAllRowsInRange();
    voLine.setCurrentRow(rLines[0]); //to this point there is no current Row of the V.O.
    Row row = voLine.getCurrentRow(); // row == null
    if you do:
    ViewObject voLine = am.findViewObject("theVO");
    voLine.setRangeSize(-1);
    voLine.getAllRowsInRange();
    Row [] rLines = voLine.findByKey(new Key(new Object[]{ Pkval1, Pkval2 }),1);
    // to this point rLines > 0
    voLine.setCurrentRow(rLines[0]); //to this point the current row of the V.O. is OK.
    Row row = voLine.getCurrentRow(); //row has the data you get the rowset correctly positioned.
    Is this a bug or a feature?, if a feature, did you forget to document it? Why do we have to learn those things the hard way?
    The desired behavior would be to move the RowSet to a new (valid) Row, regardless of the RangeSize setting that the Rowset
    had when the Row was found, next Rel please?
    OBC4J makes me remember that to developers:
    1) What seems easy is difficult,
    2) what seems difficult is Impossible,
    and 3) what seems impossible that guy at the corner store is doing without Computers... :)
    null

    Hi Alexander,
    Sorry your experience has been frustrating.
    In your first code snippet, here is what is happening:
    When you call findByKey, BC4J looks in the cache for the rowset of the VO. If it does not find the information you have asked for in the cache, it creates a new, temporary view object on your behalf, and uses that to retrieve the rows. Now, when you later call setCurrentRow, you're setting the current row of the temporary view object. The next call to getCurrentRow on the original view object doesn't work. I'm sure there are some cases where this behavior is desirable, and doesn't cause adverse side-affects.
    I'm sorry if I'm doing a terrible job explaining this. It is coming second hand from the developer I spoke with. He said that using getRow() instead of findByKey() was a better way to ensure you're working the VO you specify.
    BC4J can be a pretty complicated but powerful framework. We are continually trying to improve our documentation coverage, but it is a huge job.
    We appreciate your patience and your feedback, and we do put it to good use!

  • CreateRow,insertRow, removeCurrentRow and findByKey odities in VIewObject

    I have a view object, which has rowsetlistener and i use createRow, insertRow, commit and findByKey and there are problems. The Key of the viewobject consists of to attributes. And Here is what I do:
    ViewObject vo = panelBinding.getApplicationModule().findViewObject("AnyView");
    vo.addListener(new RowSetListener(){ //Adding listener that will be notified on isert and delete events
    public void rowInserted(InsertEvent e){
    System.out.println("Inserted row with key = "+e.getRow().getKey());
    public void rowDeleted(DeleteEvent e){
    System.out.println("Deleted row with key = "+e.getRow().getKey());
    public void navigated(NavigationEvent e){}
    public void rowUpdated(UpdateEvent e){}
    public void rangeScrolled(ScrollEvent e){}
    public void rangeRefreshed(RangeRefreshEvent e){}
    Key k = new Key(new Number[]{new Number(1),new Number(1)}); //A Full Key That will identify inserted row
    System.out.println("Found Row Count at the beginning is "+vo.findByKey(k,-1).length); //At The Beginning there are no rows with such key
    Row r = vo.createRow();
    r.setAttribute("Attr1","1"); //Set the fisrt Attr of the Key
    r.setAttribute("Attr2","1"); //Set The Second Attr of the Key
    r.setAttribute("AnyOtherAttr","AnyData");
    System.out.println("Found Row Count after set of attributes is "+vo.findByKey(k,-1).length); //No rows as sais javadoc
    vo.insertRow(r); //The Listener has been notified about the row insertion as expected
    System.out.println("Found Row Count after insertion of the row is "+vo.findByKey(k,-1).length); //One Row as should be
    vo.getApplicationModule().getTransaction().commit();
    // The Following 3 Problems will disappear if I use:
    // vo.executeQuery();
    // But if I have a lot of rows in a vo this is not a good idea.
    Row[] rows = vo.findByKey(k,-1); //THE PROBLEM #1: findByKey AFTER COMMIT/POST notifies the listener about the row insertion AGAIN ???
    System.out.println("Found Row Count after commit/post is "+vo.findByKey(k,-1).length); //THE PROBLEM #2: TWO ROWS ???
    rows = vo.findByKey(k,-1);
    rows[0].remove(); //THE PROBLEM #3: The Listener has been nitified twice about the removal of the row ???
    System.out.println("Found Row Count after remove is "+vo.findByKey(k,-1).length); //And 0 rows as expected
    vo.getApplicationModule().getTransaction().commit();
    Any suggestions or thoughts will be appreciated.
    Thanks

    David:
    This is a bug. I filed a bug and will fix it ASAP.
    Thank you for reporting it.
    A workaround would be to call executeQuery(). I know it's not ideal, but that's the easiest workaround I can think of.
    Thanks again.
    Sung

  • JUTreeBinding - navigation by findByKey() problem

    It will not be easy to provide a test case, so I hope that the following questions will clear things up for me.
    We have two trees. Both trees have the same structure. Both trees should act as navigation tool.
    This is done by using a TreeSelectionListener which somewhat looks like the JUTreeDefaultMouseListener, except:
    It uses findByKey() and setCurrentRow() on the target RowSet so this RowSetIterator's currency is set and so that the ViewLink "chain" is activated.
    Two problems:
    - findByKey() does not return a row.
    - both trees are not completely separated.
    I did some research on the JUTreeBinding and in my test project, both problems didn't show up, so I am puzzled.
    So my questions are:
    1.)
    Both VOs (the VO the tree node is bound to and the target VO) are two instances of the same VO type.
    In the Javadocs, I read "We now use the key build a where-clause for an internal View Object. That where-clause is applied and qualifying rows are retrieved from it to find the requested number of rows." So it should always come up with at least one row, since both VOs are of the same type, right? Is there another thing that could keep findByKey() from finding a row? How does this where-clause look like?
    2.)
    If I have two trees with the same structure, then JClient creates an internal VO for every node type except the top-level VO. The problem seems to be: When I have two trees then there are two RowSets for each node type, but they are contained within the very same VO. One RowSet for tree A, one for tree B. So, under certain circumstances, if the user clicks a node in tree A (which then turns out to be a leaf) then the parent node of the corresponding node in tree B collapses (and vice versa). Initially both parent nodes collapsed, but I put in the workaround for the bug in JUTreeNodeBinding.updateValuesFromRows() Shailesh mentioned in an earlier posting. Now only the other tree collapses.
    It seems to me, that the event (one tree node turning out to be a leaf) is - in that case unnecessarily - forwarded to all RowSets within the VO. So when the user clicks a node in one tree, updateValuesFromRows() is executed in both trees. How can I turn this off?
    If this won't help, then I will try to come up with a test case.
    One other thing: While I read the source of JUTreeDefaultMouseListener, I found the method setRulesActions(). According to the Javadocs, one can pass a String[][]. According to the sources the method looks like this:
      public void setRulesActions(String [][] rulesactions)
         hm.clear();
      }Strange, isn't it. Can't figure out how this is supposed to work.
    Regards and thanks in advance,
    Sascha Herrmann

    The two trees closing out at random is due to 'different' binding-iterator instances used internally for the node-accessors. We'd be investigating this further!
    We would update this post once we have a workaround/bug.

  • BUG: DBSequence.equals(Number) != Number.equals(DBSequence)

    Hi,
    I've noticed that the oracle.jbo.domain.DBSequence (Oracle specific) class' equals method differs in behaviour from the oracle.jbo.domain.Number (Oracle specific) class' equals method.
    When comparing a DBSequence with a Number (with the exact same value) the DBSequence.equals(Number) method call returns true, but the Number.equals(DBSequence) method returns false.
    This behaviour makes it somewhat more difficult to use the findByKey and getRow methdos of a ViewObject instance to find a certain row.
    It seems to me this behaviour is a bug, but maybe this behaviour is on purpose, but I could not think of any good reason for it...
    Regards,
    Peter

    Well, if I can recall correctly we had the following problem:
    Somewhere in our application we are using a bounded JTree for which we created a special view in the database because it looks something like the following:
    Departement1
    |-- Department1a
    |   |-- Department1aa
    |   |   \-- Employee4
    |   |-- Employee2
    |   \-- Employee3
    \-- Employee1As you can see there is a mix of departments and employees on different levels. This can not be done using the BC4J tree binding without using discriminator based approach and creating a special view for it.
    This view contains (in our case) a primary key that consists of 3 attributes. A fake attribute which is the employee number or department number prefixed by an 'e' for employees or a 'd' for departments, to make sure the attribute always has a unique value. Next to this the key consists of the employee and department id's (numbers). In the ViewObject the employee and department numbers are of the type "Number".
    We synchronize the selection in the tree with the real department and employee ViewObjects which we use for editting purposes. These ViewObjects have a key attribute of the type "DBSequence". To synchronize the ViewObjects we first created a key for either the department or the employee ViewObject using the following snippet of code:
    if ("department".equals(_treeRow.getAttribute("Discr"))
      Object[] key = new Object[1];
      key[0] = _treeRow.getAttribute("DepartmentId");
      Row[] rows = _deptView.findByKey(new Key(key), 1);
      if (rows.length == 1)
        _deptView.setCurrentRow(rows[0]);
    else
      // same stuff, but for employee
    }We expected this to work, because you can also set the value of a "Number" attribute with a "DBSequence" value in which case the sequence number is automatically used as the numeric value.
    But unfortunately it doesn't work because of the way the equals(...) method of both classes behave (as described above). Of course there are plenty of easy workarounds. For example make the attributes for "DepartmentId" and "EmployeeId" of type "DBSequence" in the tree ViewObject. Or make the key attributes in the department and employee ViewObjects of type "Number" (and enable the checkbox refresh-after-insert) or by changing the following line:
      key[0] = _treeRow.getAttribute("DepartmentId");to:
      key[0] = ((DBSequence)_treeRow.getAttribute("DepartmentId")).getSequenceNumber();But I really don't like any of the solutions. First of all because workaround 1 and 2 (which are very similar) are really just workarounds. And I don't like the workaround of retrieving the sequence number because I really don't want to know if it's either a DBSequence or a Number when working with the ViewObject (I might change it in the future and don't want to change any of my client code because of this), I just want to know if it's a numeric type or not.
    If Number would know about DBSequence it would not have been a problem. Even better if DBSequence would extend the Number class it would not have been a problem (is there a special reason why this hasn't been done?).
    So making the change I proposed earlier would make the DBSequence/Number stuff a lot more transparent, because at the end I really don't want to know in my client code whatever I'm dealing with a DBSequence value or an ordinary Number...
    With kind regards,
    Peter

  • Index with "or" clause (BUG still exists?)

    The change log for 2.3.10 mentions "Fixed a bug that caused incorrect query plans to be generated for predicates that used the "or" operator in conjunction with indexes [#15328]."
    But looks like the Bug still exists.
    I am listing the steps to-repro. Let me know if i have missed something (or if the bug needs to be fixed)
    DATA
    dbxml> openContainer test.dbxml
    dbxml> getDocuments
    2 documents found
    dbxml> print
    <node><value>a</value></node>
    <node><value>b</value></node>
    INDEX (just one string equality index on node "value")
    dbxml> listIndexes
    Index: unique-node-metadata-equality-string for node {http://www.sleepycat.com/2002/dbxml}:name
    Index: node-element-equality-string for node {}:value
    2 indexes found.
    QUERY
    setVerbose 2 2
    preload test.dbxml
    query 'let $temp := fn:compare("test", "test") = 0
    let $results := for $i in collection("test.dbxml")
    where ($temp or $i/node[value = ("a")])
    return $i
    return <out>{$temp}{$results}</out>'
    When $temp is true i expected the result set to contain both the records, but that was not the case with the index. It works well when there is no index!
    Result WITH INDEX
    dbxml> print
    <out>true<node><value>a</value></node></out>
    Result WITHOUT INDEX
    dbxml> print
    <out>true<node><value>a</value></node><node><value>b</value></node></out>

    Hi Vijay,
    This is a completely different bug, relating to predicate expressions that do not examine nodes. Please try the following patch, to see if it fixes this bug for you:
    --- dbxml-2.3.10-original/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp     2007-04-18 10:05:24.000000000 +0100
    +++ dbxml-2.3.10/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp     2007-08-08 11:32:10.000000000 +0100
    @@ -1566,11 +1572,12 @@
         else if(name == Or::name) {
              UnionQP *unionOp = new (&memMgr_) UnionQP(&memMgr_);
    +          result.operation = unionOp;
              for(VectorOfASTNodes::iterator i = args.begin(); i != args.end(); ++i) {
                   PathResult ret = generate(*i, ids);
                   unionOp->addArg(ret.operation);
    +               if(ret.operation == 0) result.operation = 0;
    -          result.operation = unionOp;
         // These operators use the presence of the node arguments, not their valueJohn

  • Bug report follow-up

    is there a way to follow-up on a bug report that i submitted?  i have the bug number, but would like to see if the report was understood, filled out properly and determine the status of the bug report.
    thanks,
    doug

    They comment on bugs if actions were taken. Otherwise - don't expect any feedback.

  • Solaris8 and 9 (possibly 7) /dev/poll driver bug report.

    Hello,
    I'd like to report a bug in the solaris 8 and 9 /dev/poll driver (poll(7d)).
    As i do not have a support account with sun or anything like that, there
    seems to be no other way to do that here (which is of course a very sad
    thing).
    Bug details:
    The /dev/poll device provides an ioctl-request (DP_ISPOLLED) for checking
    if a particular filedescriptor is currently in the set of monitored
    filedescriptors for that particular /dev/poll fd set (open /dev/poll fd).
    A quote from the documentation of the poll(7d) manual page taken from
    Solaris9:
    "DP_ISPOLLED ioctl allows you to query if a file descriptor is already in
    the monitored set represented by fd. The fd field of the pollfd structure
    indicates the file descriptor of interest. The DP_ISPOLLED ioctl returns 1
    if the file descriptor is in the set. The events field contains the
    currently polled events. The revents field contains 0. The ioctl returns 0
    if the file descriptor is not in the set. The pollfd structure pointed by
    pfd is not modified. The ioctl returns a -1 if the call fails."
    It says that when you query for an filedescriptor which is currently being
    monitored in the set, that it would return 1, and change the events field of
    the pollfd structure to the events it's currently monitoring that fd for.
    The revents field would be set to zero.
    However the only thing which actually happens here, is that FD_ISPOLLED
    returns 1 when the fd is in the set and 0 if not. When the fd is in the
    set, when FD_ISPOLLED returns 1, the events field remains unmodified, but
    the revents field gets changed.
    A small sample code to illustrate:
    #include <stdio.h>
    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <sys/devpoll.h>
    main() {
    struct pollfd a;
    int dp_fd = open("/dev/poll", O_WRONLY);
    a.fd = 0; /* stdin */
    a.events = POLLIN; /* we monitor for readability, POLLIN=1 */
    a.revents = 0;
    write(dp_fd, &a, sizeof(a));
    a.fd = 0;
    a.events = 34; /* filled in with bogus number to show malfunctioning */
    a.revents = 0;
    printf("DP_ISPOLLED returns: %d\n", ioctl(dp_fd, DP_ISPOLLED, &a));
    printf("a.fd=%d, a.events=%hd, a.revents=%hd\n", a.fd, a.events,
    a.revents);
    According to the documentation of /dev/poll and namely DP_ISPOLLED this
    program is supposed to print the following:
    DP_ISPOLLED returns: 1
    a.fd=0, a.events=1, a.revents=0
    However it prints the following:
    DP_ISPOLLED returns: 1
    a.fd=0, a.events=34, a.revents=1
    You can take any number instead of '34' and it will simply remain untouched
    after the DP_ISPOLLED ioctl-request.
    I hope it's clear now that the solaris8 and solaris9 (and probably solaris7
    with /dev/poll patch too) DP_ISPOLLED implementation is broken.
    This bug is also easily illustrated by looking at the solaris8 kernel sourcecode:
    <snippet osnet_volume/usr/src/uts/common/io/devpoll.c:dpioctl()>
    case DP_ISPOLLED:
    pollfd_t pollfd;
    polldat_t *pdp;
    if (pollfd.fd < 0) {
    mutex_exit(&pcp->pc_lock);
    break;
    pdp = pcache_lookup_fd(pcp, pollfd.fd);
    if ((pdp != NULL) && (pdp->pd_fd == pollfd.fd) &&
    (pdp->pd_fp != NULL)) {
    pollfd.revents = pdp->pd_events;
    if (copyout(&pollfd, (caddr_t)arg,
    sizeof(pollfd_t))) {
    mutex_exit(&pcp->pc_lock);
    DP_REFRELE(dpep);
    return (set_errno(EFAULT));
    *rvalp = 1;
    </snippet>
    its' clearly visible that the code writes the current monitored events to
    the revents field:
    'pollfd.revents = pdp->pd_events;'
    and that it doesnt set revents to zero.
    It's funny to see that this has been like this since Solaris8 (possibly 7). That means nobody ever used DP_ISPOLLED that way or people were simply to lazy to file a bug report.
    Another funny thing related to this. is that Hewlett-Packard did seem to know about this. Since HP-UX11i version 1.6 they also support /dev/poll. From their manual page i ll quote some sentences from their WARNING session:
    "The ioctl(DP_ISPOLLED) system call also returns its result in the revents member of the pollfd structure, in order to be compatible with the implementation of the /dev/poll driver by some other vendors."
    Hopefully this will get fixed.
    I also like to reexpress my very negative feelings towards the fact that you're not able to file bug reports when you do not have a support contract. Ridiculous.
    Thanks,
    bighawk

    Have I mentioned how much i love my playbook now Great job on os 2.0

  • [bdb bug]repeatly open and close db may cause memory leak

    my test code is very simple :
    char *filename = "xxx.db";
    char *dbname = "xxx";
    for( ; ;)
    DB *dbp;
    DB_TXN *txnp;
    db_create(&dbp,dbenvp, 0);
    dbenvp->txn_begin(dbenvp, NULL, &txnp, 0);
    ret = dbp->open(dbp, txnp, filename, dbname, DB_BTREE, DB_CREATE, 0);
    if(ret != 0)
    printf("failed to open db:%s\n",db_strerror(ret));
    return 0;
    txnp->commit(txnp, 0);
    dbp->close(dbp, DB_NOSYNC);
    I try to run my test program for a long time opening and closing db repeatly, then use the PS command and find the RSS is increasing slowly:
    ps -va
    PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
    1986 pts/0 S 0:00 466 588 4999 980 0.3 -bash
    2615 pts/0 R 0:01 588 2 5141 2500 0.9 ./test
    after a few minutes:
    ps -va
    PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
    1986 pts/0 S 0:00 473 588 4999 976 0.3 -bash
    2615 pts/0 R 30:02 689 2 156561 117892 46.2 ./test
    I had read bdb's source code before, so i tried to debug it for about a week and found something like a bug:
    If open a db with both filename and dbname, bdb will open a db handle for master db and a db handle for subdb,
    both of the two handle will get an fileid by a internal api called __dbreg_get_id, however, just the subdb's id will be
    return to bdb's log region by calling __dbreg_pop_id. It leads to a id leak if I tried to open and close the db
    repeatly, as a result, __dbreg_add_dbentry will call realloc repeatly to enlarge the dbentry area, this seens to be
    the reason for RSS increasing.
    Is it not a BUG?
    sorry for my pool english :)
    Edited by: user9222236 on 2010-2-25 下午10:38

    I have tested my program using Oracle Berkeley DB release 4.8.26 and 4.7.25 in redhat 9.0 (Kernel 2.4.20-8smp on an i686) and AIX Version 5.
    The problem is easy to be reproduced by calling the open method of db handle with both filename and dbname being specified and calling the close method.
    My program is very simple:
    #include <stdlib.h>
    #include <stdio.h>
    #include <sys/time.h>
    #include "db.h"
    int main(int argc, char * argv[])
    int ret, count;
    DB_ENV *dbenvp;
    char * filename = "test.dbf";
    char * dbname = "test";
    db_env_create(&dbenvp, 0);
    dbenvp->open(dbenvp, "/home/bdb/code/test/env",DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_INIT_MPOOL, 0);
    for(count = 0 ; count < 10000000 ; count++)
    DB *dbp;
    DB_TXN *txnp;
    db_create(&dbp,dbenvp, 0);
    dbenvp->txn_begin(dbenvp, NULL, &txnp, 0);
    ret = dbp->open(dbp, txnp, filename, dbname, DB_BTREE, DB_CREATE, 0);
    if(ret != 0)
    printf("failed to open db:%s\n",db_strerror(ret));
    return 0;
    txnp->commit(txnp, 0);
    dbp->close(dbp, DB_NOSYNC);
    dbenvp->close(dbenvp, 0);
    return 0;
    DB_CONFIG is like below:
    set_cachesize 0 20000 0
    set_flags db_auto_commit
    set_flags db_txn_nosync
    set_flags db_log_inmemory
    set_lk_detect db_lock_minlocks
    Edited by: user9222236 on 2010-2-28 下午5:42
    Edited by: user9222236 on 2010-2-28 下午5:45

  • Multiple return values (Bug-ID 4222792)

    I had exactly the same request for the same 3 reasons: strong type safety and code correctness verification at compile-time, code readability and ease of mantenance, performance.
    Here is what Sun replied to me:
    Autoboxing and varargs are provided as part of
    JSRs 14 and 201
    http://jcp.org/en/jsr/detail?id=14
    http://jcp.org/en/jsr/detail?id=201
    See also:
    http://forum.java.sun.com/forum.jsp?forum=316
    http://developer.java.sun.com/developer/earlyAccess/adding_generics/index.html
    Multiple return values is covered by Bug-ID 4222792
    Typically this is done by returning an array.
    http://developer.java.sun.com/developer/bugParade/bugs/4222792.html
    That's exactly the problem: we dynamically create instances of array objects that would better fit well within the operand stack without stressing the garbage collector with temporary Array object instances (and with their backing store: 2 separate allocations that need to be recycled when it is clearly a pollution that the operand stack would clean up more efficiently)
    If you would like to engage in a discussion with the Java Language developers, the Generics forum would be a better place:
    http://forum.java.sun.com/forum.jsp?forum=316
    I know that (my report was already refering to the JSR for language extension) Generics is not what I was refering to (even if a generic could handle multiple return values, it would still be an allocated Object
    instance to pack them, i.e. just less convenient than using a static class for type safety.
    The most common case of multiple return values involve values that have known static datatypes and that should be checked with strong typesafety.
    The simple case that involves returning two ints then will require at least two object instances and will not solve the garbage collection overhead.
    Using a array of variable objects is exactly similar, except that it requires two instances for the components and one instance for the generic array container. Using extra method parameters with Integer, Byte, ... boxing objects is more efficient, but for now the only practical solution (which causes the least pollution in the VM allocator and garbage collector) is to use a custom class to store the return values in a single instance.
    This is not natural, and needlessly complexifies many interfaces.
    So to avoid this pollution, some solutions are used such as packing two ints into a long and returning a long, depacking the long after return (not quite clean but still much faster at run-time for methods that need to be used with high frequencies within the application. In some case, the only way to cut down the overhead is to inline methods within the caller code, and this does not help code maintenance by splitting the implementation into small methods (something that C++ can do very easily, both because it supports native types parameters by reference, and because it also supports inline methods).
    Finally, suppose we don't want to use tricky code, difficult to maintain, then we'll have to use boxing Object types to allow passing arguments by reference. Shamely boxed native types cannot be allocated on the operand stack as local variables, so we need to instanciate these local variables before call, and we loose the capacity to track the cases where these local variables are not really initialized by an effective call to the method that will assign them. This does not help debugging, and is against the concept of a strongly typed language like Java should be:
    Java makes lots of efforts to track uninitialized variables, but has no way to determine if an already instanciated Object instance refered in a local variable has effectively received an effective assignment because only the instanciation is kept. A typical code will then need to be written like this:
    Integer a = null;
    Integer b = null;
    if (some condition) {
    //call.method(a, b, 0, 1, "dummy input arg");
    // the method is supposed to have assigned a value to a and b,
    // but can't if a and b have not been instanciated, so we perform:
    call.method(a = new Integer(), b = new Integer(), 0, 1, "dummy input
    arg");
    // we must suppose that the method has modified (not initialized!)
    the value
    // of a and b instances.
    now.use(a.value(), b.value())
    // are we sure here that a and b have received a value????
    // the code may be detected at run-time (a null exception)
    // or completely undetected (the method() above was called but it
    // forgot to assign a value to its referenced objects a and b, in which
    // case we are calling in fact: now.use(0, 0); with the default values
    // or a and b, assigned when they were instanciated)
    Very tricky... Hard to debug. It would be much simpler if we just used:
    int a;
    int b;
    if (some condition) {
    (a, b) = call.method(0, 1, "dummy input arg");
    now.use(a, b);
    The compiler would immediately detect the case where a and b are in fact not always initialized (possible use bere initialization), and the first invoked call.method() would not have to check if its arguments are not null, it would not compile if it forgets to return two values in some code path...
    There's no need to provide extra boxing objects in the source as well as at run-time, and there's no stress added to the VM allocator or garbage collector simply because return values are only allocated on the perand stack by the caller, directly instanciated within the callee which MUST (checked at compile-time) create such instances by using the return statement to instanciate them, and the caller now just needs to use directly the variables which were referenced before call (here a and b). Clean and mean. And it allows strong typechecking as well (so this is a real help for programmers.
    Note that the signature of the method() above is:
    class call {
    (int, int) method(int, int, String) { ... }
    id est:
    class "call", member name "method", member type "(IILjava.lang.string;)II"
    This last signature means that the method can only be called by returning the value into a pair of variables of type int, or using the return value as a pair of actual arguments for another method call such as:
    call.method(call.method("dummy input arg"), "other dummy input arg")
    This is strongly typed and convenient to write and debug and very efficient at run-time...

    Can anyone give me some real-world examples where
    multiple return values aren't better captured in a
    class that logically groups those values? I can of
    course give hundreds of examples for why it's better
    to capture method arguments as multiple values instead
    of as one "logical object", but whenever I've hankered
    for multiple return values, I end up rethinking my
    strategy and rewriting my code to be better Object
    Oriented.I'd personally say you're usually right. There's almost always a O-O way of avoiding the situation.
    Sometimes though, you really do just want to return "two ints" from a function. There's no logical object you can think of to put them in. So you end up polluting the namespace:
    public class MyUsefulClass {
    public TwoInts calculateSomething(int a, int b, int c) {
    public static class TwoInts {
        //now, do I use two public int fields here, making it
        //in essence a struct?
       //or do I make my two ints private & final, which
       //requires a constructor & two getters?
      //and while I'm at it, is it worth implementing
      //equals(), how about hashCode()? clone()?
      //readResolve() ?
    }The answer to most of the questions for something as simple as "TwoInts" is usually "no: its not worth implementing those methods", but I still have to think about them.
    More to the point, the TwoInts class looks so ugly polluting the top level namespace like that, MyUsefulClass.TwoInts is public, that I don't think I've ever actually created that class. I always find some way to avoid it, even if the workaround is just as ugly.
    For myself, I'd like to see some simple pass-by-value "Tuple" type. My fear is it'd be abused as a way for lazy programmers to avoid creating objects when they should have a logical type for readability & maintainability.
    Anyone who has maintained code where someone has passed in all their arguments as (mutable!) Maps, Collections and/or Arrays and "returned" values by mutating those structures knows what a nightmare it can be. Which I suppose is an argument that cuts both ways: on the one hand you can say: "why add Tuples which would be another easy thing to abuse", on the other: "why not add Tuples, given Arrays and the Collections framework already allow bad programmers to produce unmainable mush. One more feature isn't going to make a difference either way".
    Ho hum.

  • Extensions like Ghostery, WOT or AdBlock stop working after two or three times. Restarting the webpage in a new tab the extensions will work again for several times and then stop again. Has anybody an explanation or a workaround for this bug in Safari 5?

    Extensions like Ghostery, WOT or AdBlock stop working after two or three times. Restarting the webpage in a new tab the extensions will work again for several times and then stop again. Has anybody an explanation or a workaround for this bug in Safari 5?

    Remove the extensions, redownload Safari, reload the extensions.
    http://www.apple.com/safari/download/
    And if you really want a better experience, use Firefox, tons more choices and possibilities there.
    Firefox's "NoScript" will block the Trojan going around on websites. Best web security you can get.
    https://addons.mozilla.org/en-US/firefox/addon/noscript/
    Ghostery, Ad Block Plus and thousands of add-ons more have originated on Firefox.

  • Bug? My events on the iPad iCal app aren't shown in the year view if they are more than two years in the future.

    My events on the iPad iCal app aren't shown in the year view if they are more than two years in the future even though I can see them on the month, week and day view. Any suggestions on how to fix it? I've tried it all. I called the apple support and they checked on their iPads. They all did the same and they couldn't help me. They suggested trying this way. I'd like to be able to plan a few years ahead and the year view would make thing so easy!
    Is this a bug?

    Go to the Home screen and double click the Home button. That will reveal the row of recently used apps at the bottom of the screen. Tap and hold on the app in question until it wiggles and displays a minus sign. Tap the minus sign to actually quit the app. Then tap anywhere on the screen above that bottom row to return the screen to normal. Then restart the app and see if it works normally.
    Then reboot your iPad. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider until the Apple logo appears. Let go of the buttons and let the iPad restart. See if that fixes your problem.

  • HT4528 My IPhone Bugged out/It is currently in the reset mode. I need to exchange all of my contacts from my Yahoo acct. to my new IPHONE. Can you please help me?

    Hello ,
    I purchased my IPHONE about 2 months ago. I am visiting family in DE & this tuesday it starting to go off & on by itself. Then the icons looked like they were floating . Then I could not call or text . The SIRI device would not work. Then it would shut down then the apple icon would reappear. I took it to a verizon dealer in Rehoboth DE & they said it BUGGED OUT/It is in a RESTORE MODE. It will not turn on. We could not transfer anny of my pics or contacts. I never even had a chance to back up the memory on ITUNES.
    The tech @ Verizon said to contact APPLE to trouble shoot and try and transfer the contacts from my yahoo acct.
    Can you please help?
    Gina

    set up your yahoo account in mail, contacts, calendars as an Exchange Account and you should be able to get your contacts from Yahoo from there.

  • ICal bug!

    Didn't know where to post it so I decided to post it here. Not a major bug, but a bug nevertheless. Maybe someone here wants to check it out on their iCal so I get a sense if it is touching just me or anyone else.
    Follow all steps:
    - open iCal in weekly view.
    - click on a day differen than "today".
    - click on "today" on the upper left side (where "today" is written ).
    - click on the red dot to "close the app" without really closing it.
    - reopen iCal by clicking on the icon.
    Now you should have the today button greyed out, no matter which day you choose. The only way to have it back is to close and reopen iCal.
    No data loss, nothing... Just a little bug I found in iCal.
    I run Mac OSX 10.5.4 on a MacBook Pro 17" no plugins, nothing installed. Software is in italian.
    Anyway: others get the same result? (just checked it again to be really sure it is indeed not working, and it's not..)

    Has a real solution to this bug been found yet? It has been on going for me and has become annoying. The only way to get the "today" button and the search feature to work, is to quit iCal and start it again.
    Very annoying.

Maybe you are looking for

  • Photoshop CC Rasterize Text

    Hi I really like the new font anti-aliasing modes in Windows, but i got one big problem: If i rasterize text its gets a bit thicker and lose all it's touch. Here's an example: (rendering was: sharper. the top one is the non-rasterized text. looks a l

  • Hlp with a query !

    Hi, i have 14 querys on my Oracle 8i Server, I'm trying to optimize my queries, but I need a help !, well ... i speak english bad I have a report ... this has 15 fields ... it's about deposits ... for example .. one field represents one query ... i n

  • Many problems with Photoshop CS2

    Hi, I noticed many failure on CS2 softwares, i didnt upgrade to CS3 and iam wondering if it it worth the investment looking how much messy CS2s is to my projects so far. I thought they brought in CS2 to solves the many glitches in CS, but... 1 - Illu

  • Display original in ME23N

    Hello! Help me, please. Into tr. ME23 is menuitem "Invironment -> Display originals". But into tr. ME23N this menuitem is absent. How to display originals within ME23N, if it was linked to Purchase Order with ArchiveLink, for example, using tr. OAWD.

  • SAP Management Console and Services

    Good morning everyone, I am trying to understand more about the services used by the SAP System, the order in which they are / need to be started. First I have a precise question regarding what appears to be, to me, as a discrepancy between the SAP M