on 10-06-2009 11:56 PM
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();
It's indeed using a static DateFormat.
Would you be able to open a Support Message with SAP?
Sincerely,
Ted Ueda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much for checking that for me. I am hoping I will be able to get a patch for this pretty easily, since we know the line of code that is causing the problem!
I've been trying to open a support case since yesterday, but since we are a new account, they apparently need to enable something in my account so I can create a case, and that is taking a little while... I'll be in touch through one channel or another once the case has been created.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.