Skip to Content
author's profile photo Former Member
Former Member

ReportEngine SDK corrupting dates - reproducible

Hi all,

I am using the ReportEngine SDK for BusinessObjects 3.1 (with FixPack 1.5), and am encountering an issue with corrupt dates when looping through the cells of a recordset. The corruption occurs in a multi-threaded environment. I have a simple test that spawns five threads, each of which logs into BusinessObjects, then repeatedly accesses a report and loops through the cells of its recordset. The threads do not share a login context or any other ReportEngine objects (such as ReportEngines or IInfoObjects). I am including a piece of the code below - it's just a loop over a recordset. The report returns ~40 rows, and each row has one date and one double column. The corruption always occurs in getCellObject when the cell is a date. I am including some of the stack traces I have seen below.

<p>

Has anyone else encountered this problem? I am wondering if the ReportEngine possibly has a static DateFormat or SimpleDateFormat object that is being shared across threads. This is a common coding error when developers don't realize that DateFormat is not thread-safe.

<p>

Alternatively, if someone has a suggestion as to what may be incorrect about my code, please let me know.

Thanks!

<p>

[7A0FC9D3] java.lang.AssertionError: cache control: inconsictency, cachedFixedDate=733446, computed=733446, date=2009-02-08T00:00:00.000Z

at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2070)

at java.util.GregorianCalendar.computeTime(GregorianCalendar.java:2472)

at java.util.Calendar.updateTime(Calendar.java:2468)

at java.util.Calendar.getTimeInMillis(Calendar.java:1087)

at java.util.Calendar.getTime(Calendar.java:1060)

at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1368)

at java.text.DateFormat.parse(DateFormat.java:335)

at com.businessobjects.rebean.wi.RecordsetExImpl.getCellObject(Unknown Source)

<p>

[7D03DCA5] java.lang.NumberFormatException: multiple points

at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1084)

at java.lang.Double.parseDouble(Double.java:510)

at java.text.DigitList.getDouble(DigitList.java:151)

at java.text.DecimalFormat.parse(DecimalFormat.java:1303)

at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1591)

at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1312)

at java.text.DateFormat.parse(DateFormat.java:335)

at com.businessobjects.rebean.wi.RecordsetExImpl.getCellObject(Unknown Source)

<p>

[1C4D00F8] java.lang.NumberFormatException: For input string: ""

at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)

at java.lang.Long.parseLong(Long.java:424)

at java.lang.Long.parseLong(Long.java:461)

at java.text.DigitList.getLong(DigitList.java:177)

at java.text.DecimalFormat.parse(DecimalFormat.java:1298)

at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1591)

at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1312)

at java.text.DateFormat.parse(DateFormat.java:335)

at com.businessobjects.rebean.wi.RecordsetExImpl.getCellObject(Unknown Source)

<p>

java.lang.NumberFormatException: For input string: ".E0"

at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)

at java.lang.Double.parseDouble(Double.java:510)

at java.text.DigitList.getDouble(DigitList.java:151)

at java.text.DecimalFormat.parse(DecimalFormat.java:1303)

at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1936)

at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1312)

at java.text.DateFormat.parse(DateFormat.java:335)

at com.businessobjects.rebean.wi.RecordsetExImpl.getCellObject(Unknown Source)

<p>

SOURCE CODE <abbreviated>

<p>

Note: the code for logging in and retrieving the document instance is virtually the same as what is in BO docs, so I am not including it here. Again each thread logs in and retrieves the document on its own, without sharing anything between the threads. The code below is what is done (in a loop) by each of the five threads.

<p>

DocumentInstance doc = businessObjectsHelper.getReportRecordset("Test Report");

Recordset rs = doc.getDataProviders().getItem(0).getResult(0);

for (int i = 0; i < rs.getRowCount(); i++) {

for (int j = 0; j < rs.getColumnCount(); j++) {

String str1 = "" + rs.getCellObject(j);

}

rs.next();

}

doc.closeDocument();

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Oct 07, 2009 at 01:47 PM

    It's indeed using a static DateFormat.

    Would you be able to open a Support Message with SAP?

    Sincerely,

    Ted Ueda

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.