Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Error on DataSetCache: There is an error in saving files of data set cache
Error on DataSetCache: There is an error in saving files of data set cache [message #1385560] Mon, 09 June 2014 13:26 Go to next message
andy Moses is currently offline andy MosesFriend
Messages: 26
Registered: November 2013
Junior Member
Anyone has quick idea on below error?

I am using Birt report engine in java (1.6) to invoke a birt report design file which query against DB.

- There is an error in saving files of data set cache.
/var/tmp/DataEnginead56140e_c47333_7/DataSetCacheObject_53162667_8/data.data (No such file or directory)
data.engine.datasetcache.save.error ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There is an error in saving files of data set cache.

the eclipse birt library used in java are:
org.eclipse.birt runtime 4.3.1
org.eclipse.core runtime 3.9.0

The tool to create birt report design file is:
birt-rcp-report-designer version 4_2_2

The error appeared on the birt report itself, which part of it rendered and part of it has above error messages.
The error occurred on one machine but not happen on another machine.
The error seems disappeared after a few days some times, it happened occasionally.
When the error occurred, it seems the /var/tmp still have several Gigs free space so it may not be disk space not enough issue.

Anyone has seen this error before? Really appreciate if any input.

[Updated on: Mon, 09 June 2014 20:31]

Report message to a moderator

Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385581 is a reply to message #1385560] Mon, 09 June 2014 17:11 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

In what version of BIRT did you create the report?

Michael

Developer Evangelist, Silanis
Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385596 is a reply to message #1385581] Mon, 09 June 2014 19:17 Go to previous messageGo to next message
andy Moses is currently offline andy MosesFriend
Messages: 26
Registered: November 2013
Junior Member
hi, Michael,

The tool to create birt report design file is:
birt-rcp-report-designer
version 4_2_2

Thanks!
Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385701 is a reply to message #1385596] Tue, 10 June 2014 14:43 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Can you attach the design? Are you using cubes?

Michael

Developer Evangelist, Silanis
Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385710 is a reply to message #1385701] Tue, 10 June 2014 15:37 Go to previous messageGo to next message
andy Moses is currently offline andy MosesFriend
Messages: 26
Registered: November 2013
Junior Member
No cube or any advanced feature was used. Just simple report: procedure querying DB, and drag and drop field onto reports. Sorry at this moment it's not convenient to attach the report design file.

But do you know the possible causes of this error? If you have a list of possible causes, I may check one by one to see what might cause it. Thanks.
Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385847 is a reply to message #1385710] Wed, 11 June 2014 15:47 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Just wanted to take a look. I've seen similar issues in different bug reports and such. If you go to preview in the dataSet editor, can you see the data?

Michael

Developer Evangelist, Silanis
Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385850 is a reply to message #1385847] Wed, 11 June 2014 16:02 Go to previous messageGo to next message
andy Moses is currently offline andy MosesFriend
Messages: 26
Registered: November 2013
Junior Member
in preview or in webviewer has not problem. The report can be rendered without error. Even running on deployed servers mostly, mostly it's fine without this error. It's just occasionally happen but it concerned me because I don't know when it happen again.


I can see the dataset cache folder like DataEnginead56140e_c47333_7/DataSetCacheObject_53162667_8/data.data created in temp folder both on deployed server and local machine.

I thought the report design file has "Needs Cache for Data Engine" set to true by default in DataSet advanced configuration and it may cause the problem. But even with this option as true, running the birt reporting did not create dataset cache folder. So I wonder when this dataset cache folder get created. After I can tell when it get created, then I can try either removing the folder (or cached data.data file) to see if the error occur, or set the "Needs Cache for Data Engine" to false to see if the cache folder still get created or the error occurred.

The other option I plan to try is in java code, forcefully set the dataset cache option to be off in the birt AppContext setting, such as :

config.getAppContext().put(EngineConstants.APPCONTEXT_DATASET_CACHE_OPTION,false);
config.getAppContext().put(DataEngine.DATA_SET_CACHE_ROW_LIMIT, 0)

Any idea or comment are appreciated
Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385851 is a reply to message #1385850] Wed, 11 June 2014 16:17 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Can you post the java code you're using to run the design? You might try using the 4.2.2 runtime instead of the 4.3.1 runtime to see if that maybe helps. Maybe there is a bug in 4.3.1.

The caching should be off by default, I believe.


Michael

Developer Evangelist, Silanis
Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385855 is a reply to message #1385851] Wed, 11 June 2014 16:47 Go to previous messageGo to next message
andy Moses is currently offline andy MosesFriend
Messages: 26
Registered: November 2013
Junior Member
the code is similar as what on birt report document example. please attached file. Thank you.

[Updated on: Wed, 11 June 2014 17:21]

Report message to a moderator

Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385859 is a reply to message #1385855] Wed, 11 June 2014 17:11 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

I see where you define the reportName, but where are you actually using this? All I see is the birtTemplate creating a file that is used in your runAndRender task. Is there other code I'm not seeing here?

Michael

Developer Evangelist, Silanis
Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385860 is a reply to message #1385859] Wed, 11 June 2014 17:25 Go to previous messageGo to next message
andy Moses is currently offline andy MosesFriend
Messages: 26
Registered: November 2013
Junior Member
My above post with the attached file had the file updated.

The "reportName" should be the one used for fileInputStream which to open report design and create runnable.

The code is a shrunk version. All of the main code are there except comment/logging/exception handling removed mostly. Thanks.

[Updated on: Wed, 11 June 2014 17:38]

Report message to a moderator

Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385876 is a reply to message #1385860] Wed, 11 June 2014 22:18 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

What's the reason for using the input stream vs just doing:

IReportRunnable design = null;
design = engine.openReportDesign("path_to_file/report.rptdesign");

// create RunandRender Task
IRunAndRenderTask task = engine.createRunAndRenderTask(design);


Michael

Developer Evangelist, Silanis
Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385935 is a reply to message #1385876] Thu, 12 June 2014 11:12 Go to previous messageGo to next message
andy Moses is currently offline andy MosesFriend
Messages: 26
Registered: November 2013
Junior Member
Using File as input argument for engine.openReportDesign is defined API. Is there a concern about it which may cause the DataSet Cache error?

The reason could be:
To construct a File object, some validation and error handling of the file could be made before calling the engine.openReportDesign. If the report design file path is not valid, a custom error message could be returned instead of letting the openReportDesign method throws the error with its own message.

Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385939 is a reply to message #1385876] Thu, 12 June 2014 11:25 Go to previous messageGo to next message
andy Moses is currently offline andy MosesFriend
Messages: 26
Registered: November 2013
Junior Member
Michael, could you make some quick comments on below approaches on whether they might fix the data set cache error when you have time? Thank you!

1) Data Set Cache Control config on report design
http://www.eclipse.org/birt/phoenix/project/notable4.2.php#jump_11
report design file has "Needs Cache for Data Engine" set config, which can decide whether the data engine caches a data set. by default, it's true

2) in java code, config app context to set the cache

config.getAppContext().put(EngineConstants.APPCONTEXT_DATASET_CACHE_OPTION,false);
config.getAppContext().put(DataEngine.DATA_SET_CACHE_ROW_LIMIT, 0)

3) switch the birt enginer library from current 4.3.1 to 4.2.2 (4.2.2 seems to be same version as the RCP designer). Could this switch help? I noticed some user had 3.7 engine library also reported similar error before.

In my report, the data set is not bound to more than one report; There's no any above - average or advanced features used, no filter , or not any scripts used such as do after or beforeOpen script. The report is mostly a quite basic report which drag result set field on report page.

What puzzled me is that the DataSetCache error is not reproducible whenever I want, even I could make change, but I am not sure if the change is the real fix.

[Updated on: Thu, 12 June 2014 11:27]

Report message to a moderator

Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385994 is a reply to message #1385935] Thu, 12 June 2014 18:32 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

andy Moses wrote on Thu, 12 June 2014 06:12
Using File as input argument for engine.openReportDesign is defined API. Is there a concern about it which may cause the DataSet Cache error?

The reason could be:
To construct a File object, some validation and error handling of the file could be made before calling the engine.openReportDesign. If the report design file path is not valid, a custom error message could be returned instead of letting the openReportDesign method throws the error with its own message.



No. I don't believe it would cause the error, but I figured it was worth a try to do it without the input stream to see if there was something causing an issue there. Your reasoning is valid as to why use it, I just have never actually encountered this issue and since I have no way of reproducing it, I figured we could try everything. Smile


Michael

Developer Evangelist, Silanis
Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1385995 is a reply to message #1385939] Thu, 12 June 2014 18:41 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

andy Moses wrote on Thu, 12 June 2014 06:25
Michael, could you make some quick comments on below approaches on whether they might fix the data set cache error when you have time? Thank you!

1) Data Set Cache Control config on report design
http://www.eclipse.org/birt/phoenix/project/notable4.2.php#jump_11
report design file has "Needs Cache for Data Engine" set config, which can decide whether the data engine caches a data set. by default, it's true

2) in java code, config app context to set the cache

config.getAppContext().put(EngineConstants.APPCONTEXT_DATASET_CACHE_OPTION,false);
config.getAppContext().put(DataEngine.DATA_SET_CACHE_ROW_LIMIT, 0)

3) switch the birt enginer library from current 4.3.1 to 4.2.2 (4.2.2 seems to be same version as the RCP designer). Could this switch help? I noticed some user had 3.7 engine library also reported similar error before.

In my report, the data set is not bound to more than one report; There's no any above - average or advanced features used, no filter , or not any scripts used such as do after or beforeOpen script. The report is mostly a quite basic report which drag result set field on report page.

What puzzled me is that the DataSetCache error is not reproducible whenever I want, even I could make change, but I am not sure if the change is the real fix.


Unfortunately, I don't know that any of those would solve the issue. For the first one, you don't have multiple elements using the same dataSet, so that should never come into play. For number two, I'd probably say the same thing. For the third one, I only suggested this for if there were a bug in 4.3 that was causing this issue. In searching, I have seen instances of this error in versions from 2.1 to 2.5 to 4.3, now. All of them have been different at least slightly which means it may be tough to pinpoint what the issue is, especially since you say it's intermittent as it is.

It would be nice if you could put together a report design that I could run that you run into this issue with so I could test on it. I know that might be difficult though, given the intermittent nature of the issue. If we don't find the problem soon, you should definitely log a bug for it.


Michael

Developer Evangelist, Silanis
Re: Error on DataSetCache: There is an error in saving files of data set cache [message #1386198 is a reply to message #1385995] Sat, 14 June 2014 18:32 Go to previous message
andy Moses is currently offline andy MosesFriend
Messages: 26
Registered: November 2013
Junior Member
Thank you, Michael. There seems to be have a way to avoid the dataset cache error:
it's the "Needs Cache for Data Engine" property for data set's advanced option in report design, as mentioned in below link
http://www.eclipse.org/birt/phoenix/project/notable4.2.php#jump_11

What made me think above might avoid the dataset error was below:

The temp folder for dataset cache data is default "java.io.tmpdir" system property ( /var/tmp on linux and windows's temp folder under AppData/Local). In the java code which generating the birt report, I changed the temp folder system property to an non-exist folder by adding below line when initializing birt config environement:

System.setProperty("java.io.tmpdir","z:\\tmp"); //z:\\tmp does not exist.

I made code to run the birt environement each time when a birt report get created. Then I noticed quite a few error like below showed up on the birt report page

Data (id = 1785):
+ There is an error in saving files of data set cache.
z:\tmp\DataEnginef5117a8e_b09be7_4\DataSetCacheObject_45844129_3\data.data (The system cannot find the path specified)

After seeing the error, I used RCP birt report design to change the dataset property "Needs Cache for Data Engine" from true (which is default) to false. Then I refresh the page, the error disappeared.

Another property could have turn on or off the dataset cache is some line as below in java code when initializing birt environement.

engineConfig.getAppContext().put(DataEngine.DATA_SET_CACHE_ROW_LIMIT, "1000");

Although using custom temp folder can reproduce the dataset cache error, for some reason, I didn't notice the dataset folder or cache data get created in my local machine's DEFAULT temp folder when a birt report rendered. This is still a puzzle to me. That's one reason I did not reproduce the dataset cache error previously. At that time, the engineConfig only get configured once, not per report generation, even with "Needs Cache for Data Engine" set to true. After adding DataEngine.DATA_SET_CACHE_ROW_LIMIT line into java code , I saw the dataset cache folder get created immediately.

But it seems the "Needs Cache for Data Engine" has precedence over the DataEngine.DATA_SET_CACHE_ROW_LIMIT java line setting since when I set row limit to be 0 (disable cache) and set "Needs Cache for Data Engine" to true, I could see the cache error, which mean the birt engine still attempted to cache the dataset.

There's another DataEngine.MEMORY_DATA_SET_CACHE which save cache to memoery instead of hard disk temp folder. Setting this Memory cache option will make the DATA_SET_CACHE_ROW_LIMIT void or useless.

I did above on my local machine only and hopefully that "Needs Cache for Data Engine" is the way to turn off dataset Cache which I don't need.



[Updated on: Sat, 14 June 2014 18:45]

Report message to a moderator

Previous Topic:How to get row count when use group in BIRT
Next Topic:How use WebServices DataSource?
Goto Forum:
  


Current Time: Thu Apr 25 07:41:52 GMT 2024

Powered by FUDForum. Page generated in 0.03966 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top