Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Changes in DB Value not Reflected in Output

Reply
Thread Tools

Changes in DB Value not Reflected in Output

 
 
John Smith
Guest
Posts: n/a
 
      01-29-2011
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.
 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      01-29-2011
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
 
Reply With Quote
 
 
 
 
Joshua Cranmer
Guest
Posts: n/a
 
      01-29-2011
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
 
Reply With Quote
 
John Smith
Guest
Posts: n/a
 
      02-01-2011
On Jan 29, 6:40*pm, Joshua Cranmer <(E-Mail Removed)> 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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Changes in aspx page not reflected on production site Patrice ASP .Net 0 04-12-2010 08:45 AM
ASP.NET Listbox Client Side changes not reflected on page chandru ASP .Net 1 07-20-2007 03:32 PM
Client side changes not reflected in page =?Utf-8?B?cGF0cmlja2RyZA==?= ASP .Net 24 03-28-2007 02:04 AM
Changes in controls exposed as properties not reflected in design mnowosad ASP .Net Building Controls 1 03-31-2005 03:15 AM
ASP Changes not reflected Gary Millar ASP General 2 11-11-2003 09:16 PM



Advertisments