Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to save the state of a recordset in Middle Tier 1

Status
Not open for further replies.

jashy

Programmer
May 18, 2000
14
0
0
US
Hi<br>I am designing a N-tier DCOM application using VB, Oracle and MTS. I have defined methods in the MT (Middle Tier) which are called from the UI (User Interface) to retrieve large amounts of data. As sending all the retrieved data back to the UI can create huge network traffic, I am looking for an alternate way to achieve this. I want to send the retrieved data back to the UI in parts rather than all together.<br><br>However this requires me to save the state of the retrieved data in the MT between the two successive calls of the method for next chunk of rows. How can I do it? Also it will require me to save large Recordset objects in the MT for uncertain amount of time. Is it advisable to store large recordset objects in the MT or to requery the database when next chunk of rows are requested?<br><br>Thanks<br>Jatin<br><br>
 
Hi Jatin!<br><br>I dont think I have the answer to you question but I just want to ask you a question!<br><br>How do you create an instance of the Middle Tier in the user Interface Tier??? With the CreateObject(...)???<br><br>Are the machine with the UserInterface Tier logged in to the machine with the MT??? Which means -&gt; Is the client on the same domain as the server (MT)???<br><br><br>A half answer!! Im making a Timeregistartion app. that also gets data from the MT! I have a method that gets all the data from the DB! Methods in the MT Object called GetNext(), GetPriv() an so on enables me to just send the nessecery data to the UI tier! I just have the problem with DCOM so all my tiers resides on the Client except the database tier!<br><br>Nikolaj
 
<br>Regarding network traffic, I was wondering if sending multiple requests with little data is any better than sending one request with large data!
 
In the book Visual Basic 6 Business Objects, author Rockford Lhotka addresses this problem along with many other problems with COM/DCOM.&nbsp;&nbsp;Every DCOM call takes a huge amount of time and resources, so try and eliminate as many calls as you can.&nbsp;&nbsp;Although I primarily bought the book for helping me structure and create business objects there are plenty of chapters dedicated to DCOM and n-tier application solutions.&nbsp;&nbsp;One of Lhotka’s solutions is to create a buffer object which queries the database and sends the information for all child objects in a single DCOM call.&nbsp;&nbsp;&nbsp;To efficiently save and restore object state try using the lset function in vb.<br><br>Private Type objProps<br> Name as string<br> Phone as string<br> Age as Integer<br>End Type<br><br>Private mudtProps as objProps<br>Private mudtSave as objProps<br><br>‘Save object state<br>Lset mudtSave = mudtProps<br><br>‘Restore object state<br>Lset mudtProps = mudtSave<br><br>This is a very efficient method to save and restore object state for one object.&nbsp;&nbsp;When dealing with multiple child objects and DCOM calls Lhotka proposes a buffer object which holds multiple objects, so one DCOM call can transmit multiple objects.&nbsp;&nbsp;This is a very bad explanation of the strategy, to find out check out his book from Wrox.&nbsp;&nbsp;I found it incredibly useful.&nbsp;&nbsp;Although most of my work is for two tier applications, I use many of his techniques so if I ever had to upgrade to a n-tier solution it would be very easy.<br> <p>abombss<br><a href=mailto:abombss@hotmail.com>abombss@hotmail.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top