Wednesday, February 17, 2010

Temporary table residing tier

Temporary table resides on the tier where the first insert happened into it. Since temporary table data generation usually requires quite a lot of database transactions it makes sense to instantiate it on the server. However, if a temporary table is displayed on a form it makes sense to instantiate it on the client to avoid chattiness during displaying of the form. But anyway with such approach there will be a lot of client-server calls either during data generation or during displaying. To avoid that the following approach can be used:
  1. Create a temporary table instance on the server and fill it with data.
  2. Place all records from the table to a container and pass it to the client.
  3. Create a new temporary table instance on the client and fill it with data from the container.
  4. Use the client temporary table instance to display on a form.

7 comments: