Bug 837216 - REST api raw export as JSON fails for Oracle backend
REST api raw export as JSON fails for Oracle backend
Product: RHQ Project
Classification: Other
Component: Core Server (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: RHQ 4.5.0
Assigned To: Heiko W. Rupp
Mike Foley
Depends On:
Blocks: 844407
  Show dependency treegraph
Reported: 2012-07-03 03:42 EDT by Heiko W. Rupp
Modified: 2013-09-01 06:10 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 844407 (view as bug list)
Last Closed: 2013-09-01 06:10:33 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Heiko W. Rupp 2012-07-03 03:42:17 EDT
For Oracle databases exporting raw metrics fails because of 

if (!rs.isLast()) in 
as Oracle needs a special open mode for this cursor to use.

A working solution is changing
ps = connection.prepareStatement( sb.toString() );
to be
ps = connection.prepareStatement( sb.toString(), 

It is not yet clear though if that has any performance impact and if there is a 
better solution.

We could run a count-query first and then loop, but effectively this means 
double work on the database too.
Comment 1 Heiko W. Rupp 2012-07-03 03:47:56 EDT
One could probably defer writing the ',' to the start of the inner loop when 
rs.next() is true.

boolean needsComma = false;
while (rs.next()) {
   if (needsComma) 
   needsComma = true;
Comment 2 Heiko W. Rupp 2012-07-03 06:55:30 EDT
master bbf48d7
Comment 3 Heiko W. Rupp 2013-09-01 06:10:33 EDT
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.

Note You need to log in before you can comment on or make changes to this bug.