SQL query runs too many times in SQL server Profiler
Hi Experts
I have designed a report using SQL database.Report is based on Add Command Object, View and Table.Which are link and gives desired output.
However it takes long time. In the SQL Sever profiler it shows that query is executing too many times.
When in the Add Command object I edit the query Say I write TOP 5000 then it executes once however if I write Add 5001 then I face the same behavior.
I have checked "Grouping on server" option in options.
Please Advice.
Regards
Asha.
Thanks Raghavendra for reply
How adding group will help? I have to link this command objects with view and table.Also When I add "TOP 5000" in add command query it executes only 1 time in SQL query Profiler hower if edit that query to "TOP 5001" then it again it executes several time which is impacting the performance.
Please advice?
Regards
Asha.
Similar Messages
-
How to find out which query run how many times using ST03?
Hi experts,
I am trying to clean up all the junk queries in BWP. my questions is, How to find out that the particular query ran how my times in a year and by which user using ST03, How to do it step by step?
I don't like to use statistic reports for this. How to do it using ST03?
Please let me know. Thanks in advance.
Sharat.Hi,
Please find the below links which would help you solving you problem,
SAP BW performance tunning : Includes screen shots
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/68fbb490-0201-0010-8eb5-f7e0adaff5bd
SAP BW Query Performance Tuning with Aggregates:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3f66ba90-0201-0010-ac8d-b61d8fd9abe9
With Regards,
PCR -
Observer.update() runs to many times
I got two classes en Observable with an Observer
in observable:
public void function(String message) {
setChanged();
notifyObservers(message);
in observer:
public void update(Observable obs, Object obj) {
System.out.println(obj.toString());
the problem is that update is runned too many times, first time function is runned, update runs one time, next time two and then three and so on.
anyone that have had this problem and have an sollution or any tips on what that could be wrong?found out that i created lots of observers where i thought i only hade one, so i've already solved the problem
-
Oracle Apex - when I open a page the sql query runs
What do I need to change to stop the sql query running when a page is opened in Apex
the page accepts a value to search a table for relevant data. I have set a default value
every time I open the page it runs the sql query using the default valueDoes it need a default value? Why I am asking is, you could add a conditional display to your report region that would not show the report until the item has a value entered by the user..
Thank you,
Tony Miller
LuvMuffin Software
Salt Lake City, UT -
Sql Query taking very long time to complete
Hi All,
DB:oracle 9i R2
OS:sun solaris 8
Below is the Sql Query taking very long time to complete
Could any one help me out regarding this.
SELECT MAX (md1.ID) ID, md1.request_id, md1.jlpp_transaction_id,
md1.transaction_version
FROM transaction_data_arc md1
WHERE md1.transaction_name = :b2
AND md1.transaction_type = 'REQUEST'
AND md1.message_type_code = :b1
AND NOT EXISTS (
SELECT NULL
FROM transaction_data_arc tdar2
WHERE tdar2.request_id = md1.request_id
AND tdar2.jlpp_transaction_id != md1.jlpp_transaction_id
AND tdar2.ID > md1.ID)
GROUP BY md1.request_id,
md1.jlpp_transaction_id,
md1.transaction_version
Any alternate query to get the same results?
kindly let me know if any one knows.
regards,
kk.
Edited by: kk001 on Apr 27, 2011 11:23 AMDear
/* Formatted on 2011/04/27 08:32 (Formatter Plus v4.8.8) */
SELECT MAX (md1.ID) ID, md1.request_id, md1.jlpp_transaction_id,
md1.transaction_version
FROM transaction_data_arc md1
WHERE md1.transaction_name = :b2
AND md1.transaction_type = 'REQUEST'
AND md1.message_type_code = :b1
AND NOT EXISTS (
SELECT NULL
FROM transaction_data_arc tdar2
WHERE tdar2.request_id = md1.request_id
AND tdar2.jlpp_transaction_id != md1.jlpp_transaction_id
AND tdar2.ID > md1.ID)
GROUP BY md1.request_id
,md1.jlpp_transaction_id
,md1.transaction_versionCould you please post here :
(a) the available indexes on transaction_data_arc table
(b) the description of transaction_data_arc table
(c) and the formatted explain plan you will get after executing the query and issuing:
select * from table (dbms_xplan.display_cursor);Hope this helps
Mohamed Houri -
PL/SQL: ORA-00913: too many values
I don't find out why i'mg getting an "ORA-00913: too many values" Error
This Example works fine:
DECLARE
TYPE session_type IS TABLE OF v$session%ROWTYPE ;
blocking_sessions session_type;
BEGIN
select * bulk collect into blocking_sessions from v$session where blocking_session is not null;
END;
But in this Example i'm getting an ORA-00913. Can anybody tell me what i'm doing wrong?
DECLARE
TYPE session_type IS TABLE OF v$session%ROWTYPE ;
blocking_sessions session_type;
BEGIN
select distinct blocking_session bulk collect into blocking_sessions from v$session where blocking_session is not null;
END;
select distinct blocking_session bulk collect into blocking_sessions from v$session where blocking_session is not null;
ERROR at line 7:
ORA-06550: line 7, column 70:
PL/SQL: ORA-00913: too many values
ORA-06550: line 7, column 1:
PL/SQL: SQL Statement ignoredOK this one works also:
DECLARE
TYPE session_type IS TABLE OF NUMBER ;
blocking_sessions session_type;
BEGIN
select distinct blocking_session bulk collect into blocking_sessions from v$session where blocking_session is not null;
END;
But when i'm selecting for about 20 columns of a table with 30 columns. Do I have to declare every single column? -
How to check the query, which had run how many times in a year?
<Moderator Message: ok, subject is better now but you didn't search at all. Therefore thread is locked again>
Hi All,
I want to check the Query statistics like it had run how many times in a year?
Regards,
Kiran
Edited by: Siegfried Szameitat on Dec 9, 2008 11:55 AMHi Kiran,
please follow the below steps
1. Create a query for that purpose
2. Make use of BW Statistic InfoProvider 0BWTC_C02
3. in Col: Key Figure:0TCTNAVCTR
4. in Row: 0TCTQUERY (select a variable 0TCTQUYS)
5. in Filter: BW System( 0TCTSYSID) [give yr source system name whether its production/quality)
6. in Free char you can give calmonth/year or user if want to do so.
save and execute the query
you will be asked for input the query name
As output you will be getting count (as many times query is hit by all users since the time it was created)
if you give date and user name then it will display the count accordingly.
Hope it Clarifies you.
Thanks & Regards
Nagaraju.V -
A function in a subquery is call too many times.
Dear all,
I'm struggling to understand why a function in a subquery is called too many times.
Let me explain with an example:
create or replace function all_emp (v_deptno in number)
return varchar2
as
v_all_emp varchar2(2000);
begin
dbms_output.put_line ('function called');
for i in (select * from emp where deptno = v_deptno) loop
v_all_emp := v_all_emp || i.ename || '; ';
end loop;
return v_all_emp;
end;
-- running just the subquery, calls the function all_emp only 4 times (once for each row in table dept)
select
d.deptno,
d.dname,
all_emp(d.deptno) f_all_emp
from dept d;
-- running the whole query, using regexp to split the value of f_all_emp into separate fields, causes that function all_emp is called 28 times, thus 6 times for each row!!
select tmp.*,
regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
regexp_substr(f_all_emp,'[^;]*',1,11) emp6
from
(select
d.deptno,
d.dname,
all_emp(d.deptno) f_all_emp
from dept d) tmp
;I don't understand why Oracle is calling my function 28 times in this example, 4 times should be sufficient.
Is there a way to force that the subquery is materialized first?
Little background:
Above function / query is of course a simple example.
Actually I have pretty complex function, embedding in a subquery.
The subquery is already slow (2 min to run), but when I want to split the result of the funciton in multiple (approx 20) fields it's over an hour due to above described behaviour.Optimizer merges in-line view and query results in:
select d.deptno,
d.dname,
all_emp(d.deptno) f_all_emp
regexp_substr(all_emp(d.deptno),'[^;]*',1,1) emp1,
regexp_substr(all_emp(d.deptno),'[^;]*',1,3) emp2,
regexp_substr(all_emp(d.deptno),'[^;]*',1,5) emp3,
regexp_substr(all_emp(d.deptno),'[^;]*',1,7) emp4,
regexp_substr(all_emp(d.deptno),'[^;]*',1,9) emp5,
regexp_substr(all_emp(d.deptno),'[^;]*',1,11) emp6
from dept d
/That's why function is called 28 times. We can see it from explain plan:
SQL> explain plan for
2 select tmp.*,
3 regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
4 regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
5 regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
6 regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
7 regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
8 regexp_substr(f_all_emp,'[^;]*',1,11) emp6
9 from (
10 select d.deptno,
11 d.dname,
12 all_emp(d.deptno) f_all_emp
13 from dept d
14 ) tmp
15 /
Explained.
SQL> @?\rdbms\admin\utlxpls
PLAN_TABLE_OUTPUT
Plan hash value: 3383998547
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 4 | 52 | 3 (0)| 00:00:01 |
| 1 | TABLE ACCESS FULL| DEPT | 4 | 52 | 3 (0)| 00:00:01 |
8 rows selected.
SQL> If we use NO_MERGE hint:
SQL> select /*+ NO_MERGE(tmp) */
2 tmp.*,
3 regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
4 regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
5 regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
6 regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
7 regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
8 regexp_substr(f_all_emp,'[^;]*',1,11) emp6
9 from (
10 select d.deptno,
11 d.dname,
12 all_emp(d.deptno) f_all_emp
13 from dept d
14 ) tmp
15 /
DEPTNO DNAME F_ALL_EMP EMP1 EMP2 EMP3 EMP4 EMP5 EMP6
10 ACCOUNTING CLARK; KIN CLARK KING MILLER
G; MILLER;
20 RESEARCH SMITH; JON SMITH JONES SCOTT ADAMS FORD
ES; SCOTT;
ADAMS; FO
RD;
30 SALES ALLEN; WAR ALLEN WARD MARTIN BLAKE TURNER JAMES
D; MARTIN;
DEPTNO DNAME F_ALL_EMP EMP1 EMP2 EMP3 EMP4 EMP5 EMP6
BLAKE; TU
RNER; JAME
S;
40 OPERATIONS
function called
function called
function called
function called
function called
function called
SQL> explain plan for
2 select /*+ NO_MERGE(tmp) */
3 tmp.*,
4 regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
5 regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
6 regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
7 regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
8 regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
9 regexp_substr(f_all_emp,'[^;]*',1,11) emp6
10 from (
11 select d.deptno,
12 d.dname,
13 all_emp(d.deptno) f_all_emp
14 from dept d
15 ) tmp
16 /
Explained.
SQL> @?\rdbms\admin\utlxpls
PLAN_TABLE_OUTPUT
Plan hash value: 2317111044
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 4 | 8096 | 3 (0)| 00:00:01 |
| 1 | VIEW | | 4 | 8096 | 3 (0)| 00:00:01 |
| 2 | TABLE ACCESS FULL| DEPT | 4 | 52 | 3 (0)| 00:00:01 |
9 rows selected.
SQL> Not sure why function is executed 6 and not 4 times. What we actually want is to materialize in-line view:
SQL> with tmp as (
2 select /*+ materialize */
3 d.deptno,
4 d.dname,
5 all_emp(d.deptno) f_all_emp
6 from dept d
7 )
8 select tmp.*,
9 regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
10 regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
11 regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
12 regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
13 regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
14 regexp_substr(f_all_emp,'[^;]*',1,11) emp6
15 from tmp
16 /
DEPTNO DNAME F_ALL_EMP EMP1 EMP2 EMP3 EMP4 EMP5 EMP6
10 ACCOUNTING CLARK; KIN CLARK KING MILLER
G; MILLER;
20 RESEARCH SMITH; JON SMITH JONES SCOTT ADAMS FORD
ES; SCOTT;
ADAMS; FO
RD;
30 SALES ALLEN; WAR ALLEN WARD MARTIN BLAKE TURNER JAMES
D; MARTIN;
DEPTNO DNAME F_ALL_EMP EMP1 EMP2 EMP3 EMP4 EMP5 EMP6
BLAKE; TU
RNER; JAME
S;
40 OPERATIONS
function called
function called
function called
function called
SQL> explain plan for
2 with tmp as (
3 select /*+ materialize */
4 d.deptno,
5 d.dname,
6 all_emp(d.deptno) f_all_emp
7 from dept d
8 )
9 select tmp.*,
10 regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
11 regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
12 regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
13 regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
14 regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
15 regexp_substr(f_all_emp,'[^;]*',1,11) emp6
16 from tmp
17 /
Explained.
SQL> @?\rdbms\admin\utlxpls
PLAN_TABLE_OUTPUT
Plan hash value: 634594723
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 4 | 8096 | 5 (0)| 00:00:01 |
| 1 | TEMP TABLE TRANSFORMATION | | | | | |
| 2 | LOAD AS SELECT | | | | | |
| 3 | TABLE ACCESS FULL | DEPT | 4 | 52 | 3 (0)| 00:00:01 |
| 4 | VIEW | | 4 | 8096 | 2 (0)| 00:00:01 |
| 5 | TABLE ACCESS FULL | SYS_TEMP_0FD9D6603_20255AE | 4 | 52 | 2 (0)| 00:00:01 |
PLAN_TABLE_OUTPUT
12 rows selected.
SQL> However, hint MATERIALIZE is an undocumented hint.
SY. -
Unable to create report. Query produced too many results
Hi All,
Does someone knows how to avoid the message "Unable to create report. Query produced too many results" in Grid Report Type in PerformancePoint 2010. When the mdx query returns large amount of data, this message appears. Is there a way to get all
the large amount in the grid anyway?
I have set the data Source query time-out under Central Administration - Manager Service applications - PerformancePoint Service Application - PerformancePoint Service Application Settings at 3600 seconds.
Here Event Viewer log error at the server:
1. An exception occurred while running a report. The following details may help you to diagnose the problem:
Error Message: Unable to create report. Query produced too many results.
<br>
<br>
Contact the administrator for more details.
Dashboard Name:
Dashboard Item name:
Report Location: {3592a959-7c50-0d1d-9185-361d2bd5428b}
Request Duration: 6,220.93 ms
User: INTRANET\spsdshadmin
Parameters:
Exception Message: Unable to create report. Query produced too many results.
Inner Exception Message:
Stack Trace: at Microsoft.PerformancePoint.Scorecards.Server.PmServer.ExecuteAnalyticReportWithParameters(RepositoryLocation analyticReportViewLocation, BIDataContainer biDataContainer)
at Microsoft.PerformancePoint.Analytics.ServerRendering.OLAPBase.OlapViewBaseControl.ExtractReportViewData()
at Microsoft.PerformancePoint.Analytics.ServerRendering.OLAPBase.OlapViewBaseControl.CreateRenderedView(StringBuilder sd)
at Microsoft.PerformancePoint.Scorecards.ServerRendering.NavigableControl.RenderControl(HtmlTextWriter writer)
PerformancePoint Services error code 20604.
2. Unable to create report. Query produced too many results.
Microsoft.PerformancePoint.Scorecards.BpmException: Unable to create report. Query produced too many results.
at Microsoft.PerformancePoint.Scorecards.Server.Analytics.AnalyticQueryManager.ExecuteReport(AnalyticReportState reportState, DataSource dataSource)
at Microsoft.PerformancePoint.Scorecards.Server.PmServer.ExecuteAnalyticReportBase(RepositoryLocation analyticReportViewLocation, BIDataContainer biDataContainer, String formattingDimensionName)
at Microsoft.PerformancePoint.Scorecards.Server.PmServer.ExecuteAnalyticReportWithParameters(RepositoryLocation analyticReportViewLocation, BIDataContainer biDataContainer)
PerformancePoint Services error code 20605.
Thanks in advance for your help.Hello,
I would like you to try the following to adjust your readerquotas.
Change the values of the parameters listed below to a larger value. We recommend that you double the value and then run the query to check whether the issue is resolved. To do this, follow these steps:
On the SharePoint 2010 server, open the Web.config file. The file is located in the following folder:
\Program Files\Microsoft Office Servers\14.0\Web Services\PpsMonitoringServer\
Locate and change the the below values from 8192 to 16384.
Open the Client.config file. The file is located in the following folder:
\Program Files\Microsoft Office Servers\14.0\WebClients\PpsMonitoringServer\
Locate and change the below values from 8192 to 16384.
After you have made the changes, restart Internet Information Services (IIS) on the SharePoint 2010 server.
<readerQuotas
maxStringContentLength="2147483647"
maxNameTableCharCount="2147483647"
maxBytesPerRead="2147483647"
maxArrayLength="2147483647"
maxDepth="2147483647"
/>
Thanks
Heidi Tr - MSFT
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. -
Parsing the query takes too much time.
Hello.
I hitting the bug in в Oracle XE (parsing some query takes too much time).
A similar bug was previously found in the commercial release and was successfully fixed (SR Number 3-3301916511).
Please, raise a bug for Oracle XE.
Steps to reproduce the issue:
1. Extract files from testcase_dump.zip and testcase_sql.zip
2. Under username SYSTEM execute script schema.sql
3. Import data from file TESTCASE14.DMP
4. Under username SYSTEM execute script testcase14.sql
SQL text can be downloaded from http://files.mail.ru/DJTTE3
Datapump dump of testcase can be downloaded from http://files.mail.ru/EC1J36
Regards,
Viacheslav.Bug number? Version fix applies to?
Relevant Note that describes the problem and points out bug/patch availability?
With a little luck some PSEs might be "backported", since 11g XE is not base release e.g. 11.2.0.1. -
Insert Query taking too much time (5 hrs)
Hi experts,
We are using "Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi" on our server, and we are trying to execute the SQL script which inserts data into a table from 5 different table.
Note: The SQL query is been passed directly to the server.
Need your expertise as to what is causing the script to run so slow.....(It's taking around 5 hrs to execute the script).
The Script is as follow's;
Insert /*+ append */ into TABLE1 NOLOGGING
SELECT DISTINCT /*+ PARALLEL(TABLE1, 4) */ ROW_NUMBER() OVER
(ORDER BY COL1, COL2, COL3, COL4, COL5, COL6, COL7, COL8, COL9) AS PK_ID, TABLE1.COL1 AS PRODUCT_ID, TABLE1.M_NBR AS M_NBR, TABLE1.P_NBR AS P_NBR, TABLE1.C_ID AS C_ID, TABLE1.TABLE1_SERV_DT AS TABLE1_SERV_DT, TABLE1.C_KEY AS C_KEY, TABLE1.C_DEN AS C_DEN, TABLE1.A_S_DT AS A_S_DT,
TABLE1.F_ID AS F_ID, TABLE1.L_DT AS L_DT, TABLE1.A_DT AS A_DT, TABLE1.D_DT AS D_DT, TABLE1.C_TYPE AS C_TYPE,
TABLE1.S_COL AS S_COL, TABLE1.S_TBL AS S_TBL, TABLE4.ME AS ME, TABLE1.ER_YN AS ER_YN
FROM
TABLE1,
TABLE2,
TABLE3,
TABLE4,
TABLE5
WHERE
TABLE1.COL1 = TABLE2.COL1
AND
TABLE1.COL2 = TABLE3.COL2
AND
TABLE1.COL3 = TABLE4.COL3
AND
(TABLE1.SERV_DT BETWEEN RY_START AND RY_END)
AND
(TABLE1.CLAIM = :"SYS_B_0")
AND
(TABLE2.INACTIVATED = :"SYS_B_1")
AND
(TABLE2.TABLE1 = :"SYS_B_2")
AND
(TABLE2.PRELIM = :"SYS_B_3")
AND
(TABLE3.MEASURE = :"SYS_B_4")
AND
(TABLE3.EVENTS = :"SYS_B_5");In addition to APC, here's some more on the subject:
EXACT - (Default) Only statements with an exact text match will share the same SQL area.
SIMILAR - Oracle will substitute bind variable for all literals, thereby increasing the chances of a text match. Oracle will force similar statements to share the SQL area without deteriorating execution plans.
FORCE - The same as SIMILAR except that execution plans may deteriorate. This option should only be used if the risk of suboptimal plans is outweighed by the increase in cursor sharing .
Summary from:
http://www.oracle-base.com/articles/9i/performance-enhancements-9i.php#CursorSharing
In-depth:
http://www.oracle.com/technetwork/issue-archive/2006/06-jan/o16asktom-101983.html
and you can search the docs @ http://www.oracle.com/pls/db112/homepage for more.
Hope your DBA and you can fix it.
Keep us posted. -
Upgraded too many times???
i have recently upgraded my itunes to version 6 or whatever is the latest. after i had done this i decided to upgrade the software on the computer using the 'software update' option. little did i know, the updater updated my itunes. this is a second update, but two different ways. my question is, is it possible to update a program too many times and it getting corrupted or doing too many things? and when a program is updated where does the old version go? does it get stored or thrown out (i am concerned that if the old versions are stored that it would just take up space)?
When Software Update runs, it will only offer newer versions of installed software.
This normally does not corrupt the system or applications.
Sometimes applications are updated and sometimes completely replaced.
Old files are always deleted, so they don't take precious HD space.
Did you encounter problems with the iTunes update?
It's a good habit to always run Disk Utility and perform a 'Repair Disk Permissions' before and after installing/updating software.
This routine maintenance prevents most troubles.
M -
Error saying "this ID has been authorised too many times" , how to resolve ASAP?
Error saying "this ID has been authorised too many times" , how to resolve ASAP?
Adobe Live Chat: http://www.adobe.com/support/chat/ivrchat.html
They can reset your authorizations, and then you must reauthorize any devices you still need.
(Unfortunately, Adobe haven’t got round to an admin website for viewing and editing authorizations.)
Some of the representatives haven't been properly trained and don't know what to do (and claim there is nothing they can do);
in that case the only way seems to be to give up that chat and try another session hoping for a properly trained representative.
If your problem is with another device using Overdrive, Bluefire, Aldiko or similar third party app, it is recommended not to mention that app when on the chat, just mention that you have run out of authorizations (E_ACT_TOO_MANY_ACTIVATIONS) . Thanks to AJP_Bear for that tip. -
JSP bug? url.openStream() = server redirected too many times
I tried something the other day that works in Java, so it should work as a JSP scriptlet, but I received an error message that others have posted elsewhere without a compete resolution. Specifically, given a URL, say u, one ought to be able to do u.openStream() and eventually read the remote page. Typically, one might want to try
URL u = new URL("http://someserver.com/path/file.xxx")
BufferedReader bfr = new BufferedReader(new InputStreamReader(u.openStream()))and then read bfr line-by-line. The problem that seems to be fairly common is that the openStream() call throws a ProtocolException claiming "server redirected too many times (20), ."
What I've seen is that this exception occurs whenever the URL is outside the Tomcat server whence the call is being made; in our case, we're running "out-of-the-box" Jakarta Tomcat 4.1.29 on port 8080 of a w2k server. The code works perfectly in native Java and in JSP for a URL of the form "/anotherpage.jsp"
Is this a bug in JSP, or in our version of Tomcat, or is there just some configuration parameter that needs to be changed from its default? As I said, I've seen similar posts (with less detailed analysis) in the Usenet newsgroups, but not one has generated a response that explains and resolves the matter.
Perhaps a JSP guru out there could set the record straight? Thanks.
P.S. I know that the use of scriptlets in JSP is being discouraged, but they are still supported AFAIK.Sure scriptlets are still supported. Most times though you can do things better with a custom tag. Why reinvent the wheel?
Just as a suggestion, you might try the JSTL <c:import> tag.
It basically does just this behind the scenes.
However I don't think that will help you in the end - it will probably hit the same error message.
My guess would be that the problem is not caused by java/JSP as such, but by a firewall, or configuration somewhere.
The following works fine for me (ignoring broken images of course)
<%@ page import="java.net.*, java.io.*" %>
<%
URL u = new URL("http://www.google.com");
BufferedReader bfr = new BufferedReader(new InputStreamReader(u.openStream()));
String line = null;
while ((line = bfr.readLine()) != null){
out.println(line);
%>Hope this helps,
evnafets -
I have followed the steps provided by apple to restore an iPod touch. It is disabled due to having the wrong password entered too many times. When I get part way through the restore process on my computer it pops up a box saying that it can't restore until I enter the passcode into the iPod. I have tried this same process over 5 times now and keep gutting the same results. It is my kids iPod and he has only had it since September. Someone please help me before I throw the thing through the window and my kid strangles me!!! Thanks!
Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
iOS: Wrong passcode results in red disabled screen
If recovery mode does not work try DFU mode.
How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
Maybe you are looking for
-
Strange corruption problem with AVCHD
This problem is so weird I can't even figure out how to explain it, but here goes: I have video taken in the AVCHD file structure (puts clip into a nesting of folders, the MTS files are playable by Windows Media Player/VLC). The problem I'm having is
-
Can i change the "Yes" And "No" Text in the showConfirmDialog ?
if yes how? i just want to change for example from"Yes" to "Sure" Thans!
-
Hi, My 17 inch Mac pro laptop just shut down and I can't get it to turn on again. This has happen multiple times over the last six months. Looked through the forum and tried removing the battery and resetting the SMC control to no avail. I was havi
-
Was there a change in method names for ABAP Proxies ???
Hi all, i am wondering if there was a change in the method names when using ABAP proxies. In my projects there were always the methods execute_synchronous and execute_asynchronous when generating proxies. In a current project i created some ABAP prox
-
Invoicing from IDOC_INPUT_INVOIC_MRM - update DRSEG-XBLNR
Hi Expert, We have a requirement to update the field "DRSEG-XBLNR- DRSEG-XBLNR" while posting the invoice from an Idoc. Can you please suggest if you have come across similar requirement. we tried by passing into the segment type E1EDP02 with qualifi