Skip to Content
0
Former Member
Jul 20, 2007 at 10:21 PM

Multiple redundant execution of stored procedure

19 Views

I have created a simple report based on a MS SQL stored procedure and JDBC driver.

I then used this report with jrcsdk_java_howto_samples (I am using viewreport option) distributed with Crystal Reports Developer XI Release 2. (very recently downloaded 07/2007, help about shows version 11.5.8.826).

I am running the sample code in Tomcat 5.5.20 using JDBC JTDS driver (not JNDI).

JTDS driver is a very popular well established MS SQL JDBC driver.

The report displays fine.

PROBLEM: I have run a MS SQL profiler to trace execution of stored procedure calls. Crystal executers this stored procedure 3 TIMES even though I display the report only once and don't do any other user actions on it!

Tomcat trace shows

- Executing query: {CALL "CODE_TEST"."tmpusr"."tmp_crystal_tst2"()}

only once.

What is GOING on?

When I user preview option in Crystal designer, the SP is called correctly ONCE.

Can anyone share some light on this?

Here is part of Tomcat trace:

- Connection opened (Connection: databaseType=JDBC serverName=jdbc:jtds:sqlser

ver://FIONA:1434/CODE_TEST;progName=Crystal;TDS=8.0;lastUpdateCount=true state

=open databaseDriverName=crdb_jdbc.dll).

- Creating new data source

- Create new report state

- Creating totaller

- Checking for data source changes

- Checking for report state changes.

- Database fields changed

- Grouping changed

- Print Time Formula fields changed

- Linking changed

- Sorting changed

- Finished checking for report state changes.

- Data Source Manager handling report changes

- Data Source handling report changes.

- Invalidate saved data, database fields are changed.

- Invalidate saved data, linking is changed.

- Invalidating controller

- Invalidating totaller

- At the moment the code should ALWAYS regenerate the controller rather than rec

ycle parts of it in place.

- Updating special var fields

- No constant formulas

- Creating totaller

- Should verify database

- Verifying database

- Invalidating controller

- Invalidating totaller

- End verifying database

- Checking for data source changes

- Checking for report state changes.

- Database fields changed

- Grouping changed

- Print Time Formula fields changed

- Linking changed

- Sorting changed

- Finished checking for report state changes.

- Data Source Manager handling report changes

- Data Source handling report changes.

- Invalidate saved data, database fields are changed.

- Invalidate saved data, linking is changed.

- Invalidating controller

- Invalidating totaller

- At the moment the code should ALWAYS regenerate the controller rather than rec

ycle parts of it in place.

- Updating special var fields

- No constant formulas

- Creating totaller

- Two passes needed, first not finished

- Do First Pass: stop record = 0

- Regenerating saved records

- Begin reading from database

- Openning rowset

- Executing query: {CALL "CODE_TEST"."tmpusr"."tmp_crystal_tst2"()}

- End reading from database

- Close rowset

- Finished running the first pass

- Moving to Page 1

- Generating Formatted Page (1, 1)

- Page 1 formatted.

- JRCAgent1 releasing license

- JRCAgent1 received request: fetchReportTotallerRequest

- Moving to Page 1

- Encapsulating totaller

- JRCAgent1 timed out and will be cleaning up

- JRCAgent1 has cleaned up and closed down the report

- Connection Closed !net.sourceforge.jtds.jdbc.Driver!jdbc:jtds:sqlserver://FION

A:1434/CODE_TEST;progName=Crystal;TDS=8.0;lastUpdateCount=true!user=!pa

ssword=