DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 14 of 14

Thread: ADO Or XML ? What should I use ?

  1. #1
    nithya Guest

    ADO Or XML ? What should I use ?


    I have a need where a server side dll sends me 3 recordsets to the client
    side activex exe. I planned to use ADO first but the problem is that it makes
    several round trips based on some conditions. So, I am now wondering if XML
    will give me a solution.

    I've planned to have the whole set of possible data that I may need, in
    an XML and send it to the client in one go. what i need to know is

    * whether my approach is right ?
    * is there any ideal size for the xml document ? how large the document can
    be ? what are the things to be considered while determining the size ?

    can anyone help me ?

    Thanx in advance for the help

    nithya

  2. #2
    Jaco De Villiers Guest

    Re: ADO Or XML ? What should I use ?


    There are various options for you,

    If you are connecting to a MSSQL 2000 server then you can you the XML functionality
    that the database provides to send the recordset to the client.

    My suggestion would be to persist the recordset(s) to XML and then reconstruct
    them on the client. Use the data and upload the recordset to the server
    once you are done working with the data. The passing of the persisted recordset
    can also then be done in various ways. Via objects in pages / strings streamed
    to client or SOAP. The last option should be the way to go because it will
    give you a head start for future technologies.

    Hope this helps

    Jaco de Villiers


    "nithya" <nithya@nyc.com> wrote:
    >
    >I have a need where a server side dll sends me 3 recordsets to the client
    >side activex exe. I planned to use ADO first but the problem is that it

    makes
    >several round trips based on some conditions. So, I am now wondering if

    XML
    >will give me a solution.
    >
    >I've planned to have the whole set of possible data that I may need, in
    >an XML and send it to the client in one go. what i need to know is
    >
    >* whether my approach is right ?
    >* is there any ideal size for the xml document ? how large the document

    can
    >be ? what are the things to be considered while determining the size ?
    >
    >can anyone help me ?
    >
    >Thanx in advance for the help
    >
    >nithya



  3. #3
    Mark Guest

    Re: ADO Or XML ? What should I use ?


    This is the way to do it. Although there is no reason to Persist the XML.
    Transform it from Recordsets to XML and back.

    "Jaco De Villiers" <jacodv_32@hotmail.com> wrote:
    >
    >There are various options for you,
    >
    >If you are connecting to a MSSQL 2000 server then you can you the XML functionality
    >that the database provides to send the recordset to the client.
    >
    >My suggestion would be to persist the recordset(s) to XML and then reconstruct
    >them on the client. Use the data and upload the recordset to the server
    >once you are done working with the data. The passing of the persisted recordset
    >can also then be done in various ways. Via objects in pages / strings streamed
    >to client or SOAP. The last option should be the way to go because it will
    >give you a head start for future technologies.
    >
    >Hope this helps
    >
    >Jaco de Villiers
    >
    >
    >"nithya" <nithya@nyc.com> wrote:
    >>
    >>I have a need where a server side dll sends me 3 recordsets to the client
    >>side activex exe. I planned to use ADO first but the problem is that it

    >makes
    >>several round trips based on some conditions. So, I am now wondering if

    >XML
    >>will give me a solution.
    >>
    >>I've planned to have the whole set of possible data that I may need, in
    >>an XML and send it to the client in one go. what i need to know is
    >>
    >>* whether my approach is right ?
    >>* is there any ideal size for the xml document ? how large the document

    >can
    >>be ? what are the things to be considered while determining the size ?
    >>
    >>can anyone help me ?
    >>
    >>Thanx in advance for the help
    >>
    >>nithya

    >



  4. #4
    Giri Guest

    Re: ADO Or XML ? What should I use ?


    Hai Nithya

    I have understood ur problem. I don't tell that the way u r going is wrong.
    But i can give u one suggestion other than that. If u need to send 3 recordsets
    from server to the client, following is a good way.

    Just add the three recordsets to the property bag and send the property bag
    to the client in single step. It doesnot go for several round trips.

    And the way u want to follow, i.e., using xml, is a good way but the size
    of the xml will be large, retrieving will be very slow and u have to use
    dom methods.

    Regards
    Giri


    >>
    >>
    >>"nithya" <nithya@nyc.com> wrote:
    >>>
    >>>I have a need where a server side dll sends me 3 recordsets to the client
    >>>side activex exe. I planned to use ADO first but the problem is that it

    >>makes
    >>>several round trips based on some conditions. So, I am now wondering if

    >>XML
    >>>will give me a solution.
    >>>
    >>>I've planned to have the whole set of possible data that I may need,

    in
    >>>an XML and send it to the client in one go. what i need to know is
    >>>
    >>>* whether my approach is right ?
    >>>* is there any ideal size for the xml document ? how large the document

    >>can
    >>>be ? what are the things to be considered while determining the size ?
    >>>
    >>>can anyone help me ?
    >>>
    >>>Thanx in advance for the help
    >>>
    >>>nithya

    >>

    >



  5. #5
    Adrian Murphy Guest

    Re: ADO Or XML ? What should I use ?




    Hi,

    Keep with the XML!!

    Let the ActiveX DLL execute its queries and then build an XML
    response. Rather than send the XML DOM across the network, just
    send the XML string ie. MSXML.DOMDocument.XML. Perhaps, as an
    event after the XML has been created.

    The ActiveX EXE takes the XML response, open's it and does
    whatever...

    Give me a shout if you have issues.


    Cheers

    Adrian




    "Giri" <giri_yerra4@yahoo.com> wrote:
    >
    >Hai Nithya
    >
    >I have understood ur problem. I don't tell that the way u r going is wrong.
    >But i can give u one suggestion other than that. If u need to send 3 recordsets
    >from server to the client, following is a good way.
    >
    >Just add the three recordsets to the property bag and send the property

    bag
    >to the client in single step. It doesnot go for several round trips.
    >
    >And the way u want to follow, i.e., using xml, is a good way but the size
    >of the xml will be large, retrieving will be very slow and u have to use
    >dom methods.
    >
    >Regards
    >Giri
    >
    >
    >>>
    >>>
    >>>"nithya" <nithya@nyc.com> wrote:
    >>>>
    >>>>I have a need where a server side dll sends me 3 recordsets to the client
    >>>>side activex exe. I planned to use ADO first but the problem is that

    it
    >>>makes
    >>>>several round trips based on some conditions. So, I am now wondering

    if
    >>>XML
    >>>>will give me a solution.
    >>>>
    >>>>I've planned to have the whole set of possible data that I may need,

    >in
    >>>>an XML and send it to the client in one go. what i need to know is
    >>>>
    >>>>* whether my approach is right ?
    >>>>* is there any ideal size for the xml document ? how large the document
    >>>can
    >>>>be ? what are the things to be considered while determining the size

    ?
    >>>>
    >>>>can anyone help me ?
    >>>>
    >>>>Thanx in advance for the help
    >>>>
    >>>>nithya
    >>>

    >>

    >



  6. #6
    Kannan Guest

    Re: ADO Or XML ? What should I use ?


    Hi Nithya
    It is good to use XML than ADO. I am using it in my Project and currently
    i am receiving about 30 to 40 KB of Data as XML to the client. It is easier,
    flexible and reusable if you use XML. Use the XMLHTTP call to call an ASP
    ( also u can pass parameters to the server from client ) which returns XML
    to client. The beauty is you dont need to refresh the page. I fyou need further
    info mail me.

    Kannan

    "nithya" <nithya@nyc.com> wrote:
    >
    >I have a need where a server side dll sends me 3 recordsets to the client
    >side activex exe. I planned to use ADO first but the problem is that it

    makes
    >several round trips based on some conditions. So, I am now wondering if

    XML
    >will give me a solution.
    >
    >I've planned to have the whole set of possible data that I may need, in
    >an XML and send it to the client in one go. what i need to know is
    >
    >* whether my approach is right ?
    >* is there any ideal size for the xml document ? how large the document

    can
    >be ? what are the things to be considered while determining the size ?
    >
    >can anyone help me ?
    >
    >Thanx in advance for the help
    >
    >nithya



  7. #7
    Brian McAuley Guest

    Re: ADO Or XML ? What should I use ?


    I have tried to implement a similar type problem using
    SOAP v1.0: The client requests a recordset from the server
    so I save the ADO recordset as a persistant XML stream and send
    this back to the client using SOAP.
    On the client end I create a recordset from XML I receive
    by opening the XML in a DOMDocument and then creating the
    recordset by passing in the DOMDocument.

    The problem with this solution I have found is that it does not
    handle large recordsets (the system falls over).

    Is there another way to pass large recordsets from the Server
    to the client?

    Is it better to use MSXML without resorting to SOAP?

    "Kannan" <kannan.ramanathan@acbl.net> wrote:
    >
    >Hi Nithya
    > It is good to use XML than ADO. I am using it in my Project and currently
    >i am receiving about 30 to 40 KB of Data as XML to the client. It is easier,
    >flexible and reusable if you use XML. Use the XMLHTTP call to call an ASP
    >( also u can pass parameters to the server from client ) which returns XML
    >to client. The beauty is you dont need to refresh the page. I fyou need

    further
    >info mail me.
    >
    >Kannan
    >
    >"nithya" <nithya@nyc.com> wrote:
    >>
    >>I have a need where a server side dll sends me 3 recordsets to the client
    >>side activex exe. I planned to use ADO first but the problem is that it

    >makes
    >>several round trips based on some conditions. So, I am now wondering if

    >XML
    >>will give me a solution.
    >>
    >>I've planned to have the whole set of possible data that I may need, in
    >>an XML and send it to the client in one go. what i need to know is
    >>
    >>* whether my approach is right ?
    >>* is there any ideal size for the xml document ? how large the document

    >can
    >>be ? what are the things to be considered while determining the size ?
    >>
    >>can anyone help me ?
    >>
    >>Thanx in advance for the help
    >>
    >>nithya

    >



  8. #8
    Russell Jones Guest

    Re: ADO Or XML ? What should I use ?

    I can think of very few situations where you *should* send large recordsets
    to clients. Typically, you should either get the clients to specify
    better/more criteria so you can select fewer records, or you should page the
    recordset back to the client in smaller chunks.

    Russell Jones
    Sr. Web Development Editor,
    DevX.com

    "Brian McAuley" <brianmcauley@hotmail.com> wrote in message
    news:3add37ce$1@news.devx.com...
    >
    > I have tried to implement a similar type problem using
    > SOAP v1.0: The client requests a recordset from the server
    > so I save the ADO recordset as a persistant XML stream and send
    > this back to the client using SOAP.
    > On the client end I create a recordset from XML I receive
    > by opening the XML in a DOMDocument and then creating the
    > recordset by passing in the DOMDocument.
    >
    > The problem with this solution I have found is that it does not
    > handle large recordsets (the system falls over).
    >
    > Is there another way to pass large recordsets from the Server
    > to the client?
    >
    > Is it better to use MSXML without resorting to SOAP?
    >
    > "Kannan" <kannan.ramanathan@acbl.net> wrote:
    > >
    > >Hi Nithya
    > > It is good to use XML than ADO. I am using it in my Project and

    currently
    > >i am receiving about 30 to 40 KB of Data as XML to the client. It is

    easier,
    > >flexible and reusable if you use XML. Use the XMLHTTP call to call an ASP
    > >( also u can pass parameters to the server from client ) which returns

    XML
    > >to client. The beauty is you dont need to refresh the page. I fyou need

    > further
    > >info mail me.
    > >
    > >Kannan
    > >
    > >"nithya" <nithya@nyc.com> wrote:
    > >>
    > >>I have a need where a server side dll sends me 3 recordsets to the

    client
    > >>side activex exe. I planned to use ADO first but the problem is that it

    > >makes
    > >>several round trips based on some conditions. So, I am now wondering if

    > >XML
    > >>will give me a solution.
    > >>
    > >>I've planned to have the whole set of possible data that I may need, in
    > >>an XML and send it to the client in one go. what i need to know is
    > >>
    > >>* whether my approach is right ?
    > >>* is there any ideal size for the xml document ? how large the document

    > >can
    > >>be ? what are the things to be considered while determining the size ?
    > >>
    > >>can anyone help me ?
    > >>
    > >>Thanx in advance for the help
    > >>
    > >>nithya

    > >

    >




  9. #9
    Brian McAuley Guest

    Re: ADO Or XML ? What should I use ?


    Absolutely. I couldn't agree more.

    We are thinking of implementing a Pseudo-Recordset COM object on
    the Web Services machine, so that when the client wants to retrieve
    a recordset, the COM object gets the recordset from whatever source, stores
    it on the Web Services Server and when the client machine
    wants to retrieve the recordset it must be do it one row at a time
    from the COM object, which passes each row back using SOAP...

    The question is: is there a simpler way to implement this than
    implementing a Pseudo Recordset from scratch?

    Has someone come across a similar problem before?

    We do not want the client (an ASP page) to be able to call stored procedures
    via ADO or anything - everything must be method driven.
    And becuase of the firewall problems of DCOM we are leaning towards
    using SOAP as an interface between the client and the back end/COM object...


    "Russell Jones" <arj1@northstate.net> wrote:
    >I can think of very few situations where you *should* send large recordsets
    >to clients. Typically, you should either get the clients to specify
    >better/more criteria so you can select fewer records, or you should page

    the
    >recordset back to the client in smaller chunks.
    >
    >Russell Jones
    >Sr. Web Development Editor,
    >DevX.com
    >
    >"Brian McAuley" <brianmcauley@hotmail.com> wrote in message
    >news:3add37ce$1@news.devx.com...
    >>
    >> I have tried to implement a similar type problem using
    >> SOAP v1.0: The client requests a recordset from the server
    >> so I save the ADO recordset as a persistant XML stream and send
    >> this back to the client using SOAP.
    >> On the client end I create a recordset from XML I receive
    >> by opening the XML in a DOMDocument and then creating the
    >> recordset by passing in the DOMDocument.
    >>
    >> The problem with this solution I have found is that it does not
    >> handle large recordsets (the system falls over).
    >>
    >> Is there another way to pass large recordsets from the Server
    >> to the client?
    >>
    >> Is it better to use MSXML without resorting to SOAP?
    >>
    >> "Kannan" <kannan.ramanathan@acbl.net> wrote:
    >> >
    >> >Hi Nithya
    >> > It is good to use XML than ADO. I am using it in my Project and

    >currently
    >> >i am receiving about 30 to 40 KB of Data as XML to the client. It is

    >easier,
    >> >flexible and reusable if you use XML. Use the XMLHTTP call to call an

    ASP
    >> >( also u can pass parameters to the server from client ) which returns

    >XML
    >> >to client. The beauty is you dont need to refresh the page. I fyou need

    >> further
    >> >info mail me.
    >> >
    >> >Kannan
    >> >
    >> >"nithya" <nithya@nyc.com> wrote:
    >> >>
    >> >>I have a need where a server side dll sends me 3 recordsets to the

    >client
    >> >>side activex exe. I planned to use ADO first but the problem is that

    it
    >> >makes
    >> >>several round trips based on some conditions. So, I am now wondering

    if
    >> >XML
    >> >>will give me a solution.
    >> >>
    >> >>I've planned to have the whole set of possible data that I may need,

    in
    >> >>an XML and send it to the client in one go. what i need to know is
    >> >>
    >> >>* whether my approach is right ?
    >> >>* is there any ideal size for the xml document ? how large the document
    >> >can
    >> >>be ? what are the things to be considered while determining the size

    ?
    >> >>
    >> >>can anyone help me ?
    >> >>
    >> >>Thanx in advance for the help
    >> >>
    >> >>nithya
    >> >

    >>

    >
    >



  10. #10
    Russell Jones Guest

    Re: ADO Or XML ? What should I use ?

    Depending on the complexity of the query, I'd probably just query the COM
    object to get the next row directly from the database. That way, all you
    need to store for any given user is the set of query parameters and the ID
    of the last row sent to the client. That strategy eliminates problems with
    cached data being out-of-date.

    However, if I *did* have to cache records for performance reasons, (and the
    data wasn't too large -- less than 3Mb) I'd probably read some number of
    records into a FreeThreadedDOMDocument stored at application scope and query
    that object for the next row for each user. If the data was too large for
    that, I'd store the data from the recordset as an array and format up the
    XML for each request by retrieving the appropriate row values from the
    array.

    HTH



    "Brian McAuley" <brianmcauley@hotmail.com> wrote in message
    news:3ade26b1$1@news.devx.com...
    >
    > Absolutely. I couldn't agree more.
    >
    > We are thinking of implementing a Pseudo-Recordset COM object on
    > the Web Services machine, so that when the client wants to retrieve
    > a recordset, the COM object gets the recordset from whatever source,

    stores
    > it on the Web Services Server and when the client machine
    > wants to retrieve the recordset it must be do it one row at a time
    > from the COM object, which passes each row back using SOAP...
    >
    > The question is: is there a simpler way to implement this than
    > implementing a Pseudo Recordset from scratch?
    >
    > Has someone come across a similar problem before?
    >
    > We do not want the client (an ASP page) to be able to call stored

    procedures
    > via ADO or anything - everything must be method driven.
    > And becuase of the firewall problems of DCOM we are leaning towards
    > using SOAP as an interface between the client and the back end/COM

    object...
    >
    >
    > "Russell Jones" <arj1@northstate.net> wrote:
    > >I can think of very few situations where you *should* send large

    recordsets
    > >to clients. Typically, you should either get the clients to specify
    > >better/more criteria so you can select fewer records, or you should page

    > the
    > >recordset back to the client in smaller chunks.
    > >
    > >Russell Jones
    > >Sr. Web Development Editor,
    > >DevX.com
    > >
    > >"Brian McAuley" <brianmcauley@hotmail.com> wrote in message
    > >news:3add37ce$1@news.devx.com...
    > >>
    > >> I have tried to implement a similar type problem using
    > >> SOAP v1.0: The client requests a recordset from the server
    > >> so I save the ADO recordset as a persistant XML stream and send
    > >> this back to the client using SOAP.
    > >> On the client end I create a recordset from XML I receive
    > >> by opening the XML in a DOMDocument and then creating the
    > >> recordset by passing in the DOMDocument.
    > >>
    > >> The problem with this solution I have found is that it does not
    > >> handle large recordsets (the system falls over).
    > >>
    > >> Is there another way to pass large recordsets from the Server
    > >> to the client?
    > >>
    > >> Is it better to use MSXML without resorting to SOAP?
    > >>
    > >> "Kannan" <kannan.ramanathan@acbl.net> wrote:
    > >> >
    > >> >Hi Nithya
    > >> > It is good to use XML than ADO. I am using it in my Project and

    > >currently
    > >> >i am receiving about 30 to 40 KB of Data as XML to the client. It is

    > >easier,
    > >> >flexible and reusable if you use XML. Use the XMLHTTP call to call an

    > ASP
    > >> >( also u can pass parameters to the server from client ) which returns

    > >XML
    > >> >to client. The beauty is you dont need to refresh the page. I fyou

    need
    > >> further
    > >> >info mail me.
    > >> >
    > >> >Kannan
    > >> >
    > >> >"nithya" <nithya@nyc.com> wrote:
    > >> >>
    > >> >>I have a need where a server side dll sends me 3 recordsets to the

    > >client
    > >> >>side activex exe. I planned to use ADO first but the problem is that

    > it
    > >> >makes
    > >> >>several round trips based on some conditions. So, I am now wondering

    > if
    > >> >XML
    > >> >>will give me a solution.
    > >> >>
    > >> >>I've planned to have the whole set of possible data that I may need,

    > in
    > >> >>an XML and send it to the client in one go. what i need to know is
    > >> >>
    > >> >>* whether my approach is right ?
    > >> >>* is there any ideal size for the xml document ? how large the

    document
    > >> >can
    > >> >>be ? what are the things to be considered while determining the size

    > ?
    > >> >>
    > >> >>can anyone help me ?
    > >> >>
    > >> >>Thanx in advance for the help
    > >> >>
    > >> >>nithya
    > >> >
    > >>

    > >
    > >

    >




  11. #11
    Kent Li Guest

    Re: ADO Or XML ? What should I use ?


    Russell,

    I have a few issues with this approach:
    1. Every call to the COM object will make a connection to the db, which will
    degrade the performance of the web server
    2. Even with the same set of query parameters, you may get different recordset
    of the db in each call to db, because the db may be updated in each millisecond
    when the site is busy.

    We might try to store the recordset in XML format into application scope
    and pass record by record to the client.

    Regards
    Kent


    "Russell Jones" <arj1@northstate.net> wrote:
    >Depending on the complexity of the query, I'd probably just query the COM
    >object to get the next row directly from the database. That way, all you
    >need to store for any given user is the set of query parameters and the

    ID
    >of the last row sent to the client. That strategy eliminates problems with
    >cached data being out-of-date.
    >
    >However, if I *did* have to cache records for performance reasons, (and

    the
    >data wasn't too large -- less than 3Mb) I'd probably read some number of
    >records into a FreeThreadedDOMDocument stored at application scope and query
    >that object for the next row for each user. If the data was too large for
    >that, I'd store the data from the recordset as an array and format up the
    >XML for each request by retrieving the appropriate row values from the
    >array.
    >
    >HTH
    >
    >
    >
    >"Brian McAuley" <brianmcauley@hotmail.com> wrote in message
    >news:3ade26b1$1@news.devx.com...
    >>
    >> Absolutely. I couldn't agree more.
    >>
    >> We are thinking of implementing a Pseudo-Recordset COM object on
    >> the Web Services machine, so that when the client wants to retrieve
    >> a recordset, the COM object gets the recordset from whatever source,

    >stores
    >> it on the Web Services Server and when the client machine
    >> wants to retrieve the recordset it must be do it one row at a time
    >> from the COM object, which passes each row back using SOAP...
    >>
    >> The question is: is there a simpler way to implement this than
    >> implementing a Pseudo Recordset from scratch?
    >>
    >> Has someone come across a similar problem before?
    >>
    >> We do not want the client (an ASP page) to be able to call stored

    >procedures
    >> via ADO or anything - everything must be method driven.
    >> And becuase of the firewall problems of DCOM we are leaning towards
    >> using SOAP as an interface between the client and the back end/COM

    >object...
    >>
    >>
    >> "Russell Jones" <arj1@northstate.net> wrote:
    >> >I can think of very few situations where you *should* send large

    >recordsets
    >> >to clients. Typically, you should either get the clients to specify
    >> >better/more criteria so you can select fewer records, or you should page

    >> the
    >> >recordset back to the client in smaller chunks.
    >> >
    >> >Russell Jones
    >> >Sr. Web Development Editor,
    >> >DevX.com
    >> >
    >> >"Brian McAuley" <brianmcauley@hotmail.com> wrote in message
    >> >news:3add37ce$1@news.devx.com...
    >> >>
    >> >> I have tried to implement a similar type problem using
    >> >> SOAP v1.0: The client requests a recordset from the server
    >> >> so I save the ADO recordset as a persistant XML stream and send
    >> >> this back to the client using SOAP.
    >> >> On the client end I create a recordset from XML I receive
    >> >> by opening the XML in a DOMDocument and then creating the
    >> >> recordset by passing in the DOMDocument.
    >> >>
    >> >> The problem with this solution I have found is that it does not
    >> >> handle large recordsets (the system falls over).
    >> >>
    >> >> Is there another way to pass large recordsets from the Server
    >> >> to the client?
    >> >>
    >> >> Is it better to use MSXML without resorting to SOAP?
    >> >>
    >> >> "Kannan" <kannan.ramanathan@acbl.net> wrote:
    >> >> >
    >> >> >Hi Nithya
    >> >> > It is good to use XML than ADO. I am using it in my Project and
    >> >currently
    >> >> >i am receiving about 30 to 40 KB of Data as XML to the client. It

    is
    >> >easier,
    >> >> >flexible and reusable if you use XML. Use the XMLHTTP call to call

    an
    >> ASP
    >> >> >( also u can pass parameters to the server from client ) which returns
    >> >XML
    >> >> >to client. The beauty is you dont need to refresh the page. I fyou

    >need
    >> >> further
    >> >> >info mail me.
    >> >> >
    >> >> >Kannan
    >> >> >
    >> >> >"nithya" <nithya@nyc.com> wrote:
    >> >> >>
    >> >> >>I have a need where a server side dll sends me 3 recordsets to the
    >> >client
    >> >> >>side activex exe. I planned to use ADO first but the problem is that

    >> it
    >> >> >makes
    >> >> >>several round trips based on some conditions. So, I am now wondering

    >> if
    >> >> >XML
    >> >> >>will give me a solution.
    >> >> >>
    >> >> >>I've planned to have the whole set of possible data that I may need,

    >> in
    >> >> >>an XML and send it to the client in one go. what i need to know is
    >> >> >>
    >> >> >>* whether my approach is right ?
    >> >> >>* is there any ideal size for the xml document ? how large the

    >document
    >> >> >can
    >> >> >>be ? what are the things to be considered while determining the size

    >> ?
    >> >> >>
    >> >> >>can anyone help me ?
    >> >> >>
    >> >> >>Thanx in advance for the help
    >> >> >>
    >> >> >>nithya
    >> >> >
    >> >>
    >> >
    >> >

    >>

    >
    >



  12. #12
    Brian McAuley Guest

    Re: ADO Or XML ? What should I use ?


    this sounds promising.

    If the recordset is not too large: use a FreeThreadedDOMDocument and
    persist it at Session/Application scope...

    When you say:
    >If the data was too large for
    >that, I'd store the data from the recordset as an array and format up the
    >XML for each request by retrieving the appropriate row values from the
    >array.


    Do you mean store the array in memory as persistable object?

    In your opinion should I consider persisting the recordset as XML
    in a file if the recordset is v large?


    "Russell Jones" <arj1@northstate.net> wrote:
    >Depending on the complexity of the query, I'd probably just query the COM
    >object to get the next row directly from the database. That way, all you
    >need to store for any given user is the set of query parameters and the

    ID
    >of the last row sent to the client. That strategy eliminates problems with
    >cached data being out-of-date.
    >
    >However, if I *did* have to cache records for performance reasons, (and

    the
    >data wasn't too large -- less than 3Mb) I'd probably read some number of
    >records into a FreeThreadedDOMDocument stored at application scope and query
    >that object for the next row for each user. If the data was too large for
    >that, I'd store the data from the recordset as an array and format up the
    >XML for each request by retrieving the appropriate row values from the
    >array.
    >
    >HTH
    >
    >
    >
    >"Brian McAuley" <brianmcauley@hotmail.com> wrote in message
    >news:3ade26b1$1@news.devx.com...
    >>
    >> Absolutely. I couldn't agree more.
    >>
    >> We are thinking of implementing a Pseudo-Recordset COM object on
    >> the Web Services machine, so that when the client wants to retrieve
    >> a recordset, the COM object gets the recordset from whatever source,

    >stores
    >> it on the Web Services Server and when the client machine
    >> wants to retrieve the recordset it must be do it one row at a time
    >> from the COM object, which passes each row back using SOAP...
    >>
    >> The question is: is there a simpler way to implement this than
    >> implementing a Pseudo Recordset from scratch?
    >>
    >> Has someone come across a similar problem before?
    >>
    >> We do not want the client (an ASP page) to be able to call stored

    >procedures
    >> via ADO or anything - everything must be method driven.
    >> And becuase of the firewall problems of DCOM we are leaning towards
    >> using SOAP as an interface between the client and the back end/COM

    >object...
    >>
    >>
    >> "Russell Jones" <arj1@northstate.net> wrote:
    >> >I can think of very few situations where you *should* send large

    >recordsets
    >> >to clients. Typically, you should either get the clients to specify
    >> >better/more criteria so you can select fewer records, or you should page

    >> the
    >> >recordset back to the client in smaller chunks.
    >> >
    >> >Russell Jones
    >> >Sr. Web Development Editor,
    >> >DevX.com
    >> >
    >> >"Brian McAuley" <brianmcauley@hotmail.com> wrote in message
    >> >news:3add37ce$1@news.devx.com...
    >> >>
    >> >> I have tried to implement a similar type problem using
    >> >> SOAP v1.0: The client requests a recordset from the server
    >> >> so I save the ADO recordset as a persistant XML stream and send
    >> >> this back to the client using SOAP.
    >> >> On the client end I create a recordset from XML I receive
    >> >> by opening the XML in a DOMDocument and then creating the
    >> >> recordset by passing in the DOMDocument.
    >> >>
    >> >> The problem with this solution I have found is that it does not
    >> >> handle large recordsets (the system falls over).
    >> >>
    >> >> Is there another way to pass large recordsets from the Server
    >> >> to the client?
    >> >>
    >> >> Is it better to use MSXML without resorting to SOAP?
    >> >>
    >> >> "Kannan" <kannan.ramanathan@acbl.net> wrote:
    >> >> >
    >> >> >Hi Nithya
    >> >> > It is good to use XML than ADO. I am using it in my Project and
    >> >currently
    >> >> >i am receiving about 30 to 40 KB of Data as XML to the client. It

    is
    >> >easier,
    >> >> >flexible and reusable if you use XML. Use the XMLHTTP call to call

    an
    >> ASP
    >> >> >( also u can pass parameters to the server from client ) which returns
    >> >XML
    >> >> >to client. The beauty is you dont need to refresh the page. I fyou

    >need
    >> >> further
    >> >> >info mail me.
    >> >> >
    >> >> >Kannan
    >> >> >
    >> >> >"nithya" <nithya@nyc.com> wrote:
    >> >> >>
    >> >> >>I have a need where a server side dll sends me 3 recordsets to the
    >> >client
    >> >> >>side activex exe. I planned to use ADO first but the problem is that

    >> it
    >> >> >makes
    >> >> >>several round trips based on some conditions. So, I am now wondering

    >> if
    >> >> >XML
    >> >> >>will give me a solution.
    >> >> >>
    >> >> >>I've planned to have the whole set of possible data that I may need,

    >> in
    >> >> >>an XML and send it to the client in one go. what i need to know is
    >> >> >>
    >> >> >>* whether my approach is right ?
    >> >> >>* is there any ideal size for the xml document ? how large the

    >document
    >> >> >can
    >> >> >>be ? what are the things to be considered while determining the size

    >> ?
    >> >> >>
    >> >> >>can anyone help me ?
    >> >> >>
    >> >> >>Thanx in advance for the help
    >> >> >>
    >> >> >>nithya
    >> >> >
    >> >>
    >> >
    >> >

    >>

    >
    >



  13. #13
    Russell Jones Guest

    Re: ADO Or XML ? What should I use ?

    In-line
    "Kent Li" <kli_org@hotmail.com> wrote in message
    news:3ade8e13$1@news.devx.com...
    >
    > Russell,
    >
    > I have a few issues with this approach:
    > 1. Every call to the COM object will make a connection to the db, which

    will
    > degrade the performance of the web server

    With pooled connections and COM objects running in MTS, this should not be a
    problem.

    > 2. Even with the same set of query parameters, you may get different

    recordset
    > of the db in each call to db, because the db may be updated in each

    millisecond
    > when the site is busy.

    The alternative is that you send outdated data to the client from the cache.
    If that's OK for your application, then caching on the Web server will
    provide a marginal speed improvement. I doubt you'd notice the difference
    except for extremely busy sites.




  14. #14
    Russell Jones Guest

    Re: ADO Or XML ? What should I use ?

    See inline.
    "Brian McAuley" <brianmcauley@hotmail.com> wrote in message
    news:3adf8253$1@news.devx.com...
    >
    > this sounds promising.
    >
    > If the recordset is not too large: use a FreeThreadedDOMDocument and
    > persist it at Session/Application scope...
    >
    > When you say:
    > >If the data was too large for
    > >that, I'd store the data from the recordset as an array and format up the
    > >XML for each request by retrieving the appropriate row values from the
    > >array.

    >
    > Do you mean store the array in memory as persistable object?
    >

    No. I mean store the array as scalar data. In other words, store the array
    itself, not an object that wraps the data. That's easy to do with the
    GetRows method of the Recordset object. However, one alternative is to write
    a both-threaded object in C++ that wraps the array. You can only store
    free-threaded or both-threaded objects at application scope.

    > In your opinion should I consider persisting the recordset as XML
    > in a file if the recordset is v large?
    >

    No. If you store it as a file, you'll have to read and parse the file each
    time to get a row. That would definitely be a huge performance hit. Also, if
    the file is very large, reading it into a DOM at all is probably an
    unacceptable resource drain, because an instantiated DOMDocument takes up at
    least 3 times as much memory as the data itself.
    >
    > "Russell Jones" <arj1@northstate.net> wrote:
    > >Depending on the complexity of the query, I'd probably just query the COM
    > >object to get the next row directly from the database. That way, all you
    > >need to store for any given user is the set of query parameters and the

    > ID
    > >of the last row sent to the client. That strategy eliminates problems

    with
    > >cached data being out-of-date.
    > >
    > >However, if I *did* have to cache records for performance reasons, (and

    > the
    > >data wasn't too large -- less than 3Mb) I'd probably read some number of
    > >records into a FreeThreadedDOMDocument stored at application scope and

    query
    > >that object for the next row for each user. If the data was too large for
    > >that, I'd store the data from the recordset as an array and format up the
    > >XML for each request by retrieving the appropriate row values from the
    > >array.
    > >
    > >HTH
    > >
    > >
    > >
    > >"Brian McAuley" <brianmcauley@hotmail.com> wrote in message
    > >news:3ade26b1$1@news.devx.com...
    > >>
    > >> Absolutely. I couldn't agree more.
    > >>
    > >> We are thinking of implementing a Pseudo-Recordset COM object on
    > >> the Web Services machine, so that when the client wants to retrieve
    > >> a recordset, the COM object gets the recordset from whatever source,

    > >stores
    > >> it on the Web Services Server and when the client machine
    > >> wants to retrieve the recordset it must be do it one row at a time
    > >> from the COM object, which passes each row back using SOAP...
    > >>
    > >> The question is: is there a simpler way to implement this than
    > >> implementing a Pseudo Recordset from scratch?
    > >>
    > >> Has someone come across a similar problem before?
    > >>
    > >> We do not want the client (an ASP page) to be able to call stored

    > >procedures
    > >> via ADO or anything - everything must be method driven.
    > >> And becuase of the firewall problems of DCOM we are leaning towards
    > >> using SOAP as an interface between the client and the back end/COM

    > >object...
    > >>
    > >>
    > >> "Russell Jones" <arj1@northstate.net> wrote:
    > >> >I can think of very few situations where you *should* send large

    > >recordsets
    > >> >to clients. Typically, you should either get the clients to specify
    > >> >better/more criteria so you can select fewer records, or you should

    page
    > >> the
    > >> >recordset back to the client in smaller chunks.
    > >> >
    > >> >Russell Jones
    > >> >Sr. Web Development Editor,
    > >> >DevX.com
    > >> >
    > >> >"Brian McAuley" <brianmcauley@hotmail.com> wrote in message
    > >> >news:3add37ce$1@news.devx.com...
    > >> >>
    > >> >> I have tried to implement a similar type problem using
    > >> >> SOAP v1.0: The client requests a recordset from the server
    > >> >> so I save the ADO recordset as a persistant XML stream and send
    > >> >> this back to the client using SOAP.
    > >> >> On the client end I create a recordset from XML I receive
    > >> >> by opening the XML in a DOMDocument and then creating the
    > >> >> recordset by passing in the DOMDocument.
    > >> >>
    > >> >> The problem with this solution I have found is that it does not
    > >> >> handle large recordsets (the system falls over).
    > >> >>
    > >> >> Is there another way to pass large recordsets from the Server
    > >> >> to the client?
    > >> >>
    > >> >> Is it better to use MSXML without resorting to SOAP?
    > >> >>
    > >> >> "Kannan" <kannan.ramanathan@acbl.net> wrote:
    > >> >> >
    > >> >> >Hi Nithya
    > >> >> > It is good to use XML than ADO. I am using it in my Project and
    > >> >currently
    > >> >> >i am receiving about 30 to 40 KB of Data as XML to the client. It

    > is
    > >> >easier,
    > >> >> >flexible and reusable if you use XML. Use the XMLHTTP call to call

    > an
    > >> ASP
    > >> >> >( also u can pass parameters to the server from client ) which

    returns
    > >> >XML
    > >> >> >to client. The beauty is you dont need to refresh the page. I fyou

    > >need
    > >> >> further
    > >> >> >info mail me.
    > >> >> >
    > >> >> >Kannan
    > >> >> >
    > >> >> >"nithya" <nithya@nyc.com> wrote:
    > >> >> >>
    > >> >> >>I have a need where a server side dll sends me 3 recordsets to the
    > >> >client
    > >> >> >>side activex exe. I planned to use ADO first but the problem is

    that
    > >> it
    > >> >> >makes
    > >> >> >>several round trips based on some conditions. So, I am now

    wondering
    > >> if
    > >> >> >XML
    > >> >> >>will give me a solution.
    > >> >> >>
    > >> >> >>I've planned to have the whole set of possible data that I may

    need,
    > >> in
    > >> >> >>an XML and send it to the client in one go. what i need to know is
    > >> >> >>
    > >> >> >>* whether my approach is right ?
    > >> >> >>* is there any ideal size for the xml document ? how large the

    > >document
    > >> >> >can
    > >> >> >>be ? what are the things to be considered while determining the

    size
    > >> ?
    > >> >> >>
    > >> >> >>can anyone help me ?
    > >> >> >>
    > >> >> >>Thanx in advance for the help
    > >> >> >>
    > >> >> >>nithya
    > >> >> >
    > >> >>
    > >> >
    > >> >
    > >>

    > >
    > >

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center