Ahh I just took a second look of my example and it doesn't show what I mean at all. Say I had this piece of code:
_dal.CloseConnectionAfterQuery = false;
DataTable eventsTable = _dal.OpenQuery("GetEvents",
Parameter.GetParameter("UserID", userid, DbType.Int32, ParameterDirection.Input));
foreach (DataRow eRow in eventsTable.Rows)
{
int? id = new Nullable<int>( Convert.ToInt32(eRow["event_id"]));
string name = eRow["product"].ToString();
DateTime? start = new Nullable<DateTime>(Convert.ToDateTime(eRow["date_start"]));
DateTime? end = new Nullable<DateTime>(Convert.ToDateTime(eRow["date_end"]));
string desc = eRow["description"].ToString();
bool? bookable = new Nullable<bool>(( Convert.IsDBNull(eRow["Bookable"]) ? false : true));
Event Event(id, name, start, end, desc, bookable);
CustomQuestion eventQuestions = new CustomQuestion();
//--> The next line will query the db and run for every row in the eventsTable <--//
DataTable questionTable = _dal.OpenQuery("GetCustomEventQuestions",
Parameter.GetParameter("EventID", oneEvent.ID, DbType.Int32, ParameterDirection.Input));
foreach (DataRow qRow in questionTable.Rows)
{
CustomQuestion CustomQuestion();
oneCustomQuestion.ID = Convert.ToInt32(qRow["event_info_id"]);
oneCustomQuestion.Sequence = Convert.ToInt32(qRow["Sequence"]);
oneCustomQuestion.Header = qRow["header"].ToString();
oneEvent.AddComponent(oneCustomQuestion);
}
this.AddComponent(oneEvent);
}
_dal.CloseConnectionAfterQuery = true;
I hope the example is not too obscure. If I could make some sort of queue of objects that needs to be filled with data and then execute all the SQL statements at once while filling the objects with data, it might have an impact. Still not sure but I won't try anything if the Firebird provider doesn't support batch select anyway.
- Jon
On 11/2/06, Dean Harding <[EMAIL PROTECTED]> wrote:
The problem is not with the processing done by the server - the difference
would be miniscule (there might be differences in the fact that there is
only one execution plan cached for multiple executions, rather than 3
separate ones, but you'd barely notice that).
The difference is a simple matter of network latency. Often, and especially
with large databases like SQL Server or Oracle, the business logic and the
database are on physically separate machines. The roundtime trip from the
business layer to the database can, like I said, be in the order of
milliseconds, so any reduction in the number of roundtrips to the database
can be a big benefit (2ms is MUCH better than 10ms, say).
It's not so much a problem of bandwidth, as such, because you've usually got
a pretty fast connection, but 100MB/s does not mean you have zero latency.
Like I said, with embedded Firebird, or even server-mode firebird on the
same machine, you probably won't notice a difference. But depending on your
setup, it could make a difference.
Dean.
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] On Behalf Of
> paha
> Sent: Thursday, 2 November 2006 6:51 pm
> To: [email protected]
> Subject: Re: [Firebird-net-provider] Batch Select with Firebird provider
>
>
> Hi, why not implementing this functionality in your DataLayer class? You
> can
> pass string or StringBuilder or better own SqlScript class to method, that
> will split it into separate queries, establish connection get all the
> tables
> and return either list of DataTables or DataSet or fill DataSet, passed as
> parameter.Wouldn't it do the same things, that you expect from provider???
>
> Sorry, if i missed something important :-)
> --
> View this message in context: http://www.nabble.com/Batch-Select-with-
> Firebird-provider-tf2553213.html#a7129167
> Sent from the firebird-net-provider mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Firebird-net-provider mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Firebird-net-provider mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
