468,249 Members | 1,499 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

Crystal Report License - Multiple Thread Safe?

First let me start by saying that this problem is not consistently
reproducible. I have a windows service that creates reports for a
group of entities. This service can process multiple groups at a
single time, where each group is running in a separate thread. I have
noticed mixed behavior when running multiple groups at one time (in
separate threads). I have received the following two messages logged
as errors.

- A Crystal Reports job was delayed 2 second waiting for a free license
to become available. More licenses can be purchased direct from Crystal
Decisions or through the Crystal Decisions Online Store.

- A Crystal Reports job failed because a free license could not be
obtained in the time allocated. More licenses can be purchased direct
from Crystal Decisions or through the Crystal Decisions Online Store.

This is unique to running multiple threads simultaneously, and does not
occur if one group is processed followed by the next group in
sequential order. In addition, this does not occur every time that I
run the test.

My thought is that there is one license that is being passed around and
that only a single thread can have it at any given time. For example
if I have 4 threads that are running, and producing reports. The first
obtains the license, does its job, and drops the license. Now the
second (or any other for that matter) obtains the license, does its
job, and drops the license. However since these all threads could
potentially be requesting the license at a single point in time, this
could cause an undesired affect. If thread 1 obtains the license, and
thread 2 is waiting for it. As thread 1 releases the license, thread 3
obtains it, thread 2 is still left waiting. A few more cycles like
this, and all of a sudden thread 2 will timeout. Am I wrong in
thinking that there might be a race condition with the license and
multiple threads? Is Crystal Reports thread safe?

I'm using the Crystal Reports that is integrated with Visual Studio
2003, find the versions below.

Microsoft Development Environment 2003 Version 7.1.3088
Microsoft .NET Framework 1.1 Version 1.1.4322 SP1
Crystal Reports for Visual Studio .NET AAP50-GS00000-U7000RN

Any thoughts?


Mar 16 '06 #1
3 7960
The Crystal Reports that is included with VS.Net 2003 only supports one
concurrent thread for report generation. I've run into this problem
also. My solution was to create my own system of checking whether
there was an available license and queue the other requests. There's a
static function called something like 'GetCurrentLicenses' that's
contained in the 'ReportDocument' class, and maybe elsewhere. You can
check the integer it returns to see how many licenses are available.
AFAIK crystal doesn't do anything special to wait for a license, it
just throws an exception.

FYI: In my solution I created a high priority and low priority queue in
case the waits got long and something important was waiting (e.g. a
scheduled report would be in the low queue and a user requested report
in the high queue).

Mar 21 '06 #2
Thanks. That was my guess, but it's nice to get confirmation. It's
sad that we have to jump through hoops and provide our own semaphore to
handle report generation from multiple threads.


Mar 21 '06 #3
Yeah, I think the real answer is that Crystal wants the .Net/COM
objects to be a launch pad into a full fledged crystal enterprise
server installation. Which is why they limit the licensing so much.
It will be interesting to see if/how this changes now that MS Reporting
Services is on the market and maturing.

Mar 22 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Gudni G. Sigurdsson | last post: by
reply views Thread by Robert Warnestam | last post: by
1 post views Thread by Grey | last post: by
reply views Thread by T.J. | last post: by
9 posts views Thread by Altman | last post: by
2 posts views Thread by =?Utf-8?B?Um9zcyBNYXNvbg==?= | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.