remoting a dbase call and getting intermittent progress back...

J

Jack Addington

I am working on app that currently all resides on the same machine but plan
to pull the database off and try to move all the datafunctionality to a
remote machine. I have a data function that is processing a loop of rows
and calling a stored proc for each row. All is encapsulated within a single
oracle transaction.

I have a logic class that is making a call to the dataaccess class and
passing the rows. I can serialize the dataobject and pass the data to the
dataaccess class (in its own assembly) that in time I would like to move to
a different machine. Seems ok so far (besides the remoting issues :) ).

Anyhow I would like to tie the progress of each row to a progressbar object.
Right now I thought I could just pass the progress bar to the dataaccess
method and update it. My concern is that this won't work very well come
time to implement via remoting. Is this something that is difficult to do
or would I just be better off forgetting about the progress. If possible I
would like to avoid passing the dataconnection back and forth. I would like
to avoid having any knowledge of the database on the client side (I will be
porting to web soon enough as well).

1) preferred method

VisualClass --> calls DataAccess.DoDatabaseWork (pass datarows)
DoDatabaseWork( )
foreach row{
call sproc
update visualClass.ProgressBar
}
}

2) would like to avoid (or should I)

VisualClass
Request Connection/transaction from DataAccess
foreach row{
call dataAccess ( Connection, sproc )
update progressbar
}
request commit/rollback (connection).
 
J

Justin Rogers

The progress bar really exists on the client side in your remoting case. All
you need to do is pass back a status message indicating the number of rows
that have been inserted and the client can update their UI appropriately.
This single piece of information should be easy to pass through your layers.
 
J

Jack Addington

my case was more an update on each step of a loop inside a single method
call.

I want to make one call to the dataAccess object (which loops x times
calling a sproc for each row) and updates the progress bar with each
interation. It is far easier for me to pass the data in one go than it is
to loop through the data on the client side and pass the row details.

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top