Changes in DB Value not Reflected in Output

Discussion in 'Java' started by John Smith, Jan 29, 2011.

  1. John Smith

    John Smith Guest

    brief description of problem:
    I have created a Java app that
    - adds two columns to a GUI window
    - shows N in column if boolean flag is false; blank if boolean flag is
    true

    - adds two columns to an output file
    - shows -1 in column if boolean flag is false; 0 if boolean flag is
    true

    problem:
    - when running main entry on desktop against code base on desktop,
    then the two columns showed up on on both the GUI window as blank and
    the output file with value 0; but once I change the value from true to
    false the two columsn GUI window shows up with "N" (correct) but the
    output file shows up with 0 (incorrect - false should be -1)

    - when running main entry on desktop against code base on server, then
    the two columns showed up on on both the GUI window as blank and but
    the two columns did not even show up in the output file

    - when running main entry on server against code base on server, then
    the two columns showed up on on both the GUI window as blank ; and the
    run on the server for the output file failed with no obvious error
    show in the logs.

    note that the codebase has been deployed from desktop to server prior
    to all tests.


    summary:
    two problems here:
    - why are the two columns not showing up consistently across desktop
    and server runs?
    - why the column in the report file remains as 0 after changing the
    value from true to false?


    The Java code involves several classes and quite long to post; but I
    can provide snippets if it helps.
    Any suggestions to the two questions raised in the "summary" section
    is appreciated.

    Thanks.
     
    John Smith, Jan 29, 2011
    #1
    1. Advertising

  2. John Smith

    Arne Vajhøj Guest

    On 29-01-2011 14:15, John Smith wrote:
    > summary:
    > two problems here:
    > - why are the two columns not showing up consistently across desktop
    > and server runs?
    > - why the column in the report file remains as 0 after changing the
    > value from true to false?
    >
    >
    > The Java code involves several classes and quite long to post; but I
    > can provide snippets if it helps.
    > Any suggestions to the two questions raised in the "summary" section
    > is appreciated.


    Posting some code that can recreate the problems would give
    a better chance for a solution than waiting for somebody
    with the psychic abilities to envision your code.

    :)

    Arne
     
    Arne Vajhøj, Jan 29, 2011
    #2
    1. Advertising

  3. On 01/29/2011 02:15 PM, John Smith wrote:
    > - why are the two columns not showing up consistently across desktop
    > and server runs?


    Without knowing anything else, I am going to guess that the answer is
    you misprogrammed some concurrency code--on the desktop, contacting the
    database on itself is likely to cause some caches to end up being
    flushed and thereby causing memory to become updated across threads,
    while a database on the server is not going to cause remote cache flushes.

    > - why the column in the report file remains as 0 after changing the
    > value from true to false?


    This I can't answer without knowing anything else. Concurrency could
    again be a fault here, but I really don't know.

    > The Java code involves several classes and quite long to post; but I
    > can provide snippets if it helps.


    SSCCE would be invaluable if possible. To beat a horse to a bloody
    death, if all other explanations fail, concurrency can be a good guess
    for failure, but that does imply that most of the other code is not
    buggy in this sense. In any case, I'm not entirely sure what you're
    doing or what the correct outputs of those actions should have been, let
    alone where in the code it could be failing.

    --
    Beware of bugs in the above code; I have only proved it correct, not
    tried it. -- Donald E. Knuth
     
    Joshua Cranmer, Jan 29, 2011
    #3
  4. John Smith

    John Smith Guest

    On Jan 29, 6:40 pm, Joshua Cranmer <> wrote:
    > On 01/29/2011 02:15 PM, John Smith wrote:
    >
    > > - why are the two columns not showing up consistently across desktop
    > > and server runs?

    >
    > Without knowing anything else, I am going to guess that the answer is
    > you misprogrammed some concurrency code--on the desktop, contacting the
    > database on itself is likely to cause some caches to end up being
    > flushed and thereby causing memory to become updated across threads,
    > while a database on the server is not going to cause remote cache flushes..
    >
    > > - why the column in the report file remains as 0 after changing the
    > > value from true to false?

    >
    > This I can't answer without knowing anything else. Concurrency could
    > again be a fault here, but I really don't know.
    >
    > > The Java code involves several classes and quite long to post; but I
    > > can provide snippets if it helps.

    >
    > SSCCE would be invaluable if possible. To beat a horse to a bloody
    > death, if all other explanations fail, concurrency can be a good guess
    > for failure, but that does imply that most of the other code is not
    > buggy in this sense. In any case, I'm not entirely sure what you're
    > doing or what the correct outputs of those actions should have been, let
    > alone where in the code it could be failing.
    >
    > --
    > Beware of bugs in the above code; I have only proved it correct, not
    > tried it. -- Donald E. Knuth


    When running the following code snippet to display the two columns in
    the file,
    gen.isGenViaFeed(curve) returns true and gen.isSaveRecRate(curve)
    returns true
    so iss.setMarkitCurve(""); and iss.setMarkitRecRate(""); are
    executed

    expected behaviour:
    since I have set GEN_VIA_FEED = false via the GUI I expect
    gen.isGenViaFeed(curve) to return false
    so iss.setMarkitCurve("N"); and iss.setMarkitRecRate("N"); should be
    exectued.

    String curveKey = (iss.getCurrency() == null ? DEFAULT_CURRENCY :
    iss.getCurrency()) +
    SNP_RATING_DELIMITER +
    iss.getIssuerId() +
    SNP_RATING_DELIMITER +
    (iss.getSeniority() == null ? domainSen : iss.getSeniority()) +
    SNP_RATING_DELIMITER +
    (iss.getRestructuringType() == null ? domainRT :
    iss.getRestructuringType());

    CurveProbability curve = curvesMap.get(curveKey);

    CurveGeneratorProbability gen = new
    CurveGeneratorProbability();
    if (curve == null || gen.isGenViaFeed(curve) ) {
    iss.setMarkitCurve("");
    } else {
    iss.setMarkitCurve("N");
    }
    if ( gen.isSaveRecRate(curve) ) {
    iss.setMarkitRecRate("");
    } else {
    iss.setMarkitRecRate("N");
    }
    }

    /**
    * Is parameter GEN_VIA_FEED set to "true" (ignore case)
    *
    * @param curve Curve to examine
    * @return True or false
    */
    public boolean isGenViaFeed(Curve curve)
    {
    if (curve == null || curve.getGeneratorParameters() == null)
    {
    return false;
    }
    String param = (String)
    (curve.getGeneratorParameters()).get(GEN_VIA_FEED);
    if (param == null)
    {
    return false;
    }
    else
    {
    return param.equalsIgnoreCase("true");
    }
    }

    I found a couple of references to curve.setGeneratorParameters() but
    when I put in a breakpoint none of those references were hit.
    The obvious answer here is to "change the code such that
    curve.setGeneratorParameters() will be run"; however I have seen this
    same code being able
    to print "N" (=false) and "N" (=false) in the GUI. When print to the
    file the logic goes thorough the same code snippet, reading the same
    value in the DB.
    Why is "0" (=true) and "0" (=true") printed in the report file?
     
    John Smith, Feb 1, 2011
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?cGF0cmlja2RyZA==?=

    Client side changes not reflected in page

    =?Utf-8?B?cGF0cmlja2RyZA==?=, Feb 1, 2007, in forum: ASP .Net
    Replies:
    24
    Views:
    1,046
    =?Utf-8?B?cGF0cmlja2RyZA==?=
    Mar 28, 2007
  2. chandru
    Replies:
    1
    Views:
    636
    bruce barker
    Jul 20, 2007
  3. Patrice
    Replies:
    0
    Views:
    790
    Patrice
    Apr 12, 2010
  4. mnowosad
    Replies:
    1
    Views:
    140
    Jason Bentley
    Mar 31, 2005
  5. Gary Millar

    ASP Changes not reflected

    Gary Millar, Nov 11, 2003, in forum: ASP General
    Replies:
    2
    Views:
    139
    Ray at
    Nov 11, 2003
Loading...

Share This Page