Robert,
If the entire report doesn't need to be in the same transaction, then you can
easily create a stateful session bean that does your query and iteration over
the employees a few at a time. I would get the collection of primary keys in an
initialization method, then get a few lines at a time from a nextGroup method.
For scalability, you should do finds on one department at a time. The session
bean can then maintain the totals which you get from another bean method.
I don't really see the need for a single method call unless you want the entire
report in a single transaction. A single transaction won't scale well no matter
how you implement it.
--Victor
Robert Hargreaves wrote:
> William,
>
> > -----Original Message-----
> > Having said all of this I think a transaction taking 20 seconds is not
> > typical of the usage of Enterprise JavaBeans could you tell
> > us more about
> > this. There might be other ways to solve this problem than the above
> > mentioned and at the same time reduce the turnaround. With 20
> > seconds you
> > will increase the likelihood of collisions with other
> > transactions. The
> > holding onto the database resource can limit your scalability
> > and increase
> > the work load for your database server since it will need to use large
> > amounts of memory storage to support the transaction requirements.
>
> Actually the task being performed is a (kind of) departmental tax report for
> a payroll and so doesn't really need to be transactional at all (I think).
> It basically reads entity beans and prints a couple of lines of a data per
> employee for all employees in the department.
>
> We could actually iterate over a collection of employees from the client and
> call printTaxReport(Employee fred) on each iteration and then we could
> update the progress bar on each iteration, but we need to maintain a large
> number of running totals and then print those out at the end of the of each
> department.
>
> The task itself must scale from a single department report upto a department
> within companies within divisions report and so on. We dont really want to
> maintain the running totals on the client so thats why we've gone for a
> single method call of printTaxReport(Department sales) that lasts 20
> seconds.
>
> Regards,
>
> Robert Hargreaves
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".