473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Re: CommandType = TEXT vs Stored Procedure.

Michel Posseth [MCP] wrote:
>
Well in my office the argument to do everyhting with SP`s or IO
routines in seperate dll`s is that we do not want to have to send out
a complete version of our app just because we had some minor DB
changes
For verry small apps i can inmagine that someone uses plain sql ,
however for buiness apps i would favor stored procedures not for
perfomance , but for grouping , maintainability , easier debugging ,
easier optimizing ( wich wil give you ... extra perfomance ) etc etc
etc
In my opinion the TS is doing fine when using SP`s he did not choose
the easy way but the way with the most beuatifull view and
perspective :-) but that is just my opinion .
I agree if the database client is the end user. I think things are different if
the database client is a web service, which in turn has the end user as a
client. In that scenario, updating after DB changes means updating only the web
service, not the windows client program. In my case, I put all the DB code in a
separate dll, referenced by the web service itself. It is a database code layer
residing on the server.

If the select statements are written with parameters, I think the results are
actually better than with SPs, at least with Oracle. Note that the following is
impressions from limited testing, not an exhaustive analysis.

For an SP, the return from the SP is a reference cursor, which is then under
the control of the .Net code. Oracle will not directly reuse that cursor,
because it has been "sent out" to a non-Oracle program. It can still cache the
plan, and cache internal session cursors, but it won't leave the actual cursor
open. A second request will open a new cursor to be returned to the calling
program.

If the web service uses a select statement, the Oracle driver will cache the
statement itself. After first use, it will leave the cursor open on the server,
since it stays under Oracle control the whole time. For the second request, it
does not need a parse, and does not need to open a new cursor at all. From the
point of view of the DB server, it is the same connection asking to re-read the
same cursor.

The result in my tests was that cursor reuse went up, and parsing went down,
when the Oracle driver was allowed to cache select statements, compared to using
stored procedures on the server that returned reference cursors. This was not
tested rigorously, and I would not hang my hat on it, but when used in
conjunction with a web service, cached parameterized select statements give
excellent results.

I do appreciate hearing different points of view on this topic, and chewing over
the details. For a serious db app, getting this layer into good shape makes a
big difference in the overall result.
Jun 27 '08 #1
1 1575
Steve,

When I was reading your message I only could think: "Does Steve's
application more than managing the cursor"

Normally this should only be a minor issue to make a good solution.

Cor

"Steve Gerrard" <my********@comcast.netschreef in bericht
news:wt******************************@comcast.com. ..
Michel Posseth [MCP] wrote:
>>
Well in my office the argument to do everyhting with SP`s or IO
routines in seperate dll`s is that we do not want to have to send out
a complete version of our app just because we had some minor DB
changes
For verry small apps i can inmagine that someone uses plain sql ,
however for buiness apps i would favor stored procedures not for
perfomance , but for grouping , maintainability , easier debugging ,
easier optimizing ( wich wil give you ... extra perfomance ) etc etc
etc
In my opinion the TS is doing fine when using SP`s he did not choose
the easy way but the way with the most beuatifull view and
perspective :-) but that is just my opinion .

I agree if the database client is the end user. I think things are
different if the database client is a web service, which in turn has the
end user as a client. In that scenario, updating after DB changes means
updating only the web service, not the windows client program. In my case,
I put all the DB code in a separate dll, referenced by the web service
itself. It is a database code layer residing on the server.

If the select statements are written with parameters, I think the results
are actually better than with SPs, at least with Oracle. Note that the
following is impressions from limited testing, not an exhaustive analysis.

For an SP, the return from the SP is a reference cursor, which is then
under the control of the .Net code. Oracle will not directly reuse that
cursor, because it has been "sent out" to a non-Oracle program. It can
still cache the plan, and cache internal session cursors, but it won't
leave the actual cursor open. A second request will open a new cursor to
be returned to the calling program.

If the web service uses a select statement, the Oracle driver will cache
the statement itself. After first use, it will leave the cursor open on
the server, since it stays under Oracle control the whole time. For the
second request, it does not need a parse, and does not need to open a new
cursor at all. From the point of view of the DB server, it is the same
connection asking to re-read the same cursor.

The result in my tests was that cursor reuse went up, and parsing went
down, when the Oracle driver was allowed to cache select statements,
compared to using stored procedures on the server that returned reference
cursors. This was not tested rigorously, and I would not hang my hat on
it, but when used in conjunction with a web service, cached parameterized
select statements give excellent results.

I do appreciate hearing different points of view on this topic, and
chewing over the details. For a serious db app, getting this layer into
good shape makes a big difference in the overall result.

Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
1
by: Perre Van Wilrijk | last post by:
Hi, I've got a full text index which works fine, SQLSERVER2000/WIN 2000 SERVER. The system requires to update indexes immediately, so I use a timestamp field to enable this. No problems so...
1
by: Thilo-Alexander Ginkel | last post by:
Hello, I am currently trying to assign some string to a TEXT output parameter of a stored procedure. The basic structure of the stored procedure looks like this: -- 8< -- CREATE PROCEDURE...
4
by: laurenq uantrell | last post by:
I'm using the function below to output all of my stored procedures into a text file. Fice, except that the output file does not reflect the names of the stored procedures correctly if the name has...
1
by: Yama | last post by:
Hello, Can someone tell me how to insert text into a table containing a TEXT field? How to update? I would like to create a stored procedure that take a text parameter and inserts it into a...
2
by: honcho | last post by:
Hello, Does anyone have an example of an SQL Server stored procedure that updates a record, where one of its field is of type "text"? My procedure is /* ** Update the client note and...
4
by: nate axtell | last post by:
In a VB .NET app I changed the text of a label then proceed to run a stored procedure which takes about 20 seconds. The label change doesn't show until after the stored procedure is finished. Is...
0
by: Melanie | last post by:
Hi - my problem is as follows: I'm writing an ASP.Net 2.0 app with C#. From the app, I call a stored procedure that updates some data in the app's database (SQL Server 2000). This stored procedure...
4
by: jdokos | last post by:
Hello All, I have a procedure that is getting -443 after upgrading to V9.5 FP1. The procedure was written to output only the SQLCODE. Here is the output that is returned: Value of output...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.