JSP is executed twice

hi,
          I am running weblogic 6.1 with sp4. I have got two JSP which are using a
          datasource to connect to my database (oracle 8).
          When I got a java.sql.connection through the datasource, I am creating a
          statement and executing a query. It is a really simple query (select * from
          mytable) but mostly the JSP will be exceuted twice and I have no idea why.
          So can anyone help me?
          Michael
          

hi,
          I am running weblogic 6.1 with sp4. I have got two JSP which are using a
          datasource to connect to my database (oracle 8).
          When I got a java.sql.connection through the datasource, I am creating a
          statement and executing a query. It is a really simple query (select * from
          mytable) but mostly the JSP will be exceuted twice and I have no idea why.
          So can anyone help me?
          Michael
          

Similar Messages

  • JSP executing twice

    I am calling one JSP from another, via a Javascript function, as I am using the onclick event of an image button. I am using the following code in the calling JSP:
    <INPUT onclick="nextcitation(this.document)" accesskey="N" type="IMAGE" src="images/nextCitation1.gif">
    and the javascript function is as follows:
    function nextcitation(d)
    d.myform.action = "nccaNextCitation.jsp"
    d.myform.submit();
    return false;
    The called jsp, "nccaNextCitation.jsp" sometimes executes once, like it should, and other times it executes twice, using a second newly spawned thread. This causes a real problem, as I am using this JSP to call a servlet which feeds keystrokes in a screen scraping application to a legacy mainframe app.
    It's the inconsistency part to this that's driving me crazy. If it always happened on the first time the button was clicked or the 2nd time, it would be much easier to debug. As it is, it some time happens right away, and other times will be ok until the 5th or 6th time.
    I've searched the forums and google, and have found a few references where this happens, but none of the suggestions (mainly adding "return false") have worked.
    Is there some browser setting or something in the response header I should be looking for?
    I'm using IE 6.0 and WSAD 4.0.3 as my development tool/server.
    Thanks!

    An image input control is really a submit control. Double-submission can happen if you have an onClick handler on a submit button and have that method also do a form.submit(). You can recreate this problem using the following code (irrelevant sections are left out):
    function submitTheForm() {
        document.form.submit();
    <form>
    <input type="submit" name="submitthisform" value="Click Me" onClick="submitTheForm()">
    </form>In the above case, the form itself is submitted in response to the submit button being clicked, but also in response to the form.submit() call.
    Instead of using an image control, why not just use an HREF around an image instead? For example:
    <img src="images/nextCitation1.gif" border="0">
    Michael

  • Action executing twice while loading tiles

    hi
    I am arun
    I am using tiles-def.xml to load my layout
    actuaaly merequest going in following way
    jsp-->action--->actionforward-->sucess(layoutpage)
    jsp is executing only once
    but when the requet reaches action
    action is executing twice
    can anyone help me onthis

    Hi Udaykumar,
    Where did u removed the symbol (#).. In ur JSP (or) in tiles-def.xml (or) in action..?
    regards,
    Satheesh.J

  • JSF action executed twice

    Hello all,
    sorry for my bad english.
    I've a simple form with only one <h:commandButton> who execute an action method.
    In this method i need to do a sleep of 60 seconds.
    The strange thing is that while waiting the 60 seconds, the action method is executed twice !
    This is my code:
    SimplePage.jsp
    <h:form id="simple_form">
      <h:commandButton id="ok_button" value="OK" action="#{bBean.doAction}" />
    </h:form>BackingBean.java
      public String doAction()
        try
          Thread.sleep(60000);
        catch (InterruptedException e)
          e.printStackTrace();
        return "ok";
       }Any help is appreciate.
    Carlo

    Hi Raymond,
    thanks for the reply.
    As you suggested , I've created a JSP page with only one form and submit button that fires an action who sleep for 60 seconds.
    In this case action is invoked only once.
    Any suggestion ?
    Thanks in advance
    Carlo

  • After Update Trigger executes twice when single row is uptd thro proc

    We have the below trigger in our db. When a single record is updated using a procedure the trigger is executed twice and it inserts two records in other table.
    But when i issue an update statement using any sql client tool it is executing only once and inserts only one record in other table.
    Can any one please help me to find the reason?
    Trigger:*
    create or replace TRIGGER CX_HEADER_ESCL_T1 AFTER UPDATE OF STATUS ON CX_HEADER
    FOR EACH ROW
    DECLARE
    "b1-CTRIYJ" boolean := FALSE;
    BEGIN
    IF UPDATING('STATUS') AND(:NEW.status = 'SUCCESS') THEN
    "b1-CTRIYJ" := TRUE;
    END IF;
    IF "b1-CTRIYJ" = TRUE THEN
    INSERT
    INTO siebel.s_escl_req(req_id, created, bt_row_id, rule_id, tbl_name, created_by, group_id)
    VALUES('11111111', CURRENT_DATE, :NEW.row_id, '1-CTRIYJ', 'CX_HEADER', :NEW.last_upd_by, '1-2CU3');
    "b1-CTRIYJ" := FALSE;
    END IF;
    END;
    Procedure:
    CREATE OR REPLACE
    PROCEDURE CLOSE_BATCH
    (ChildRecordCount IN NUMBER, HeaderId IN VARCHAR2, CompletionStatus OUT VARCHAR2) AS
    CafeChildCount NUMBER;
    BEGIN
    select count(*) into CafeChildCount from SIEBEL.CX_CHILD where HEADER_ID=HeaderId;
    IF ChildRecordCount = CafeChildCount THEN
    update SIEBEL.CX_HEADER set STATUS ='SUCCESS', MODIFICATION_NUM = MODIFICATION_NUM+1 where HEADER_ID=HeaderId;
    CompletionStatus := 'SUCCESS';
    ELSE
    update SIEBEL.CX_CHILD set STATUS='FAILED' where HEADER_ID=HeaderId;
    update SIEBEL.CX_HEADER set STATUS='FAILED' where HEADER_ID=HeaderId;
    CompletionStatus := 'FAILED';
    END IF;
    commit;
    /*CompletionStatus := 'SUCCESS';*/
    EXCEPTION
    WHEN OTHERS THEN
    CompletionStatus := SQLCODE;
    rollback;
    END;

    Your problem seems not be related to the trigger restart issue I have already mentioned because you are using a AFTER UPDATE trigger and not a BEFORE UPDATE trigger:
    >
    BEFORE Triggers Fired Multiple Times
    If an UPDATE or DELETE statement detects a conflict with a concurrent UPDATE, then Oracle Database performs a transparent ROLLBACK to SAVEPOINT and restarts the update. This can occur many times before the statement completes successfully. Each time the statement is restarted, the BEFORE statement trigger is fired again. The rollback to savepoint does not undo changes to any package variables referenced in the trigger. Your package should include a counter variable to detect this situation.
    >
    If you are sure that you update a single row and that your trigger fires twice and if you can easiily reproduce the issue, I recommend that you contact Oracle Support and create a Service Request for your issue that could be an Oracle bug.

  • WPF Animation execute twice

    Hi All,
    I faced an issue regarding the Animation execute twice, please check the code:
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <ListView x:Name="lstHandled" Grid.Column="0" Visibility="Visible">
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListView.Triggers>
    <EventTrigger RoutedEvent="ListView.MouseEnter">
    <BeginStoryboard>
    <Storyboard>
    <ThicknessAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Margin)"
    From="-100,0,0,0" To="0,0,0,0"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    </ListView.Triggers>
    </ListView>
    <StackPanel x:Name="spAll" Grid.Column="0" Width="100" Margin="-100,0,0,0" Orientation="Horizontal">
    <ListView x:Name="Handled">
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    </ListView>
    <ListView x:Name="UnHandled">
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    </ListView>
    <StackPanel.Triggers>
    <EventTrigger RoutedEvent="StackPanel.MouseLeave">
    <BeginStoryboard>
    <Storyboard>
    <ThicknessAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Margin)"
    From="0,0,0,0" To="-100,0,0,0"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    </StackPanel.Triggers>
    </StackPanel>
    </Grid>
    Here is the screenshot:
    When the mouse leave the "spAll" StackPanel. It fired the Mouse Enter event for the ListView. How to avoid this issue? 
    Thanks a lot!
    The future belongs to those who believe in the beauty of their dreams.

    You put your other two listviews in the same column of the grid.
    Since they're defined later, they will be above the first listview... and cause your problem.
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <ListView x:Name="lstHandled" Grid.Column="0" Visibility="Visible">
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListView.Triggers>
    <EventTrigger RoutedEvent="ListView.MouseEnter">
    <BeginStoryboard>
    <Storyboard>
    <DoubleAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Width)"
    From="0" To="120"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    <EventTrigger RoutedEvent="ListView.MouseLeave">
    <BeginStoryboard>
    <Storyboard>
    <DoubleAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Width)"
    From="120" To="0"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    </ListView.Triggers>
    </ListView>
    <StackPanel x:Name="spAll" Grid.Column="1" Width="0" Orientation="Horizontal">
    <ListView x:Name="Handled">
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    </ListView>
    <ListView x:Name="UnHandled" Grid.Column="2">
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    </ListView>
    </StackPanel>
    </Grid>
    The above puts your listviews in different columns, although I'm not 100% sure that's what you wanted to happen.
    You would also have to animate the first listview if you want that to disappear.
    There's a potential problem there since as you do that your mouse will leave it.
    I guess you're probably just kind of playing around learning stuff here though.
     PS
    I based this on your first, now deleted, thread.
    Hope that helps.
    Technet articles: Uneventful MVVM;
    All my Technet Articles

  • Why the code in a user exit is executed twice?

    Hi all,
    I've got a development in a user exit EXIT_SAPMP56T_001.
    This user exit allows us to control the travel expenses.
    When you go to the TX: PR05 you can see a list with travels to add expenses. Here you can select one item on the list and press the edit button to add new expenses.
    We want to control this and we use this user exit for that purpose.
    When the user selects a row and presses the edit button, the user exit is triggered. We can check the values of the table and see which row is selected. But this exit is executed twice. The first time the table doesn't have any changes on it, the second time it has marked the selected row.
    Why is this happening? Why is this exit executed twice? And how can I control that the table is properlly updated?
    Thank you.

    Hi,
    I think this user exist in getting triggered both in the PAI and PBO of that screen.
    For avoiding this use the flag.
    If flag is initial then only your code needs to trigger.
    if flag is initial.
    flag = 'X'.
    then your code.
    endif.
    So when it again comes into the PBO it will check the flag and the same code will not be triggered for the second time.
    With Regards,
    Sumodh.P

  • Why is the last script executed twice?

    Here is my problem. I have two files, file1.sql and file2.sql that are called in a third file test.sql. The output from test.sql show that file2.sql was called twice
    --file1.sql
    select 'file1' as str from dual;
    --file2.sql
    select 'file2' as str from dual;
    --test.sql
    @file1.sql
    @file2.sql
    The output shows:
    STR
    file1
    STR
    file2
    STR
    file2
    Why is the last file execute twice. If I change the order of files in test.sql, then file1 is displayed twice

    I found my problem. In test.sql I had '/' in the last line
    --test.sql
    @file1.sql
    @file2.sql
    /

  • When I schedule a Job, the job is executed twice.

    Post Author: sachinddalal
    CA Forum: Data Integration
    Hello,
    I am using Data Integrator Ver 11.0.2.22. I have scheduled the job through Admin Console. When the job is executed it seems that the job is executed twice.
    On the Status tab onDI Administrator, it shows that both the jobs started at same time. The end time of bot the job is different.
    Any one have any idea how this happens?
    Also any way to ensure that the job are not executed twice.
    Thanks,
    Regards
    Sachin Dalal

    Post Author: bhofmans
    CA Forum: Data Integration
    If you get this issue for a scheduled job only, I might be that the schedule is created twice in the OS scheduler. You could check the windows task scheduler (or cron on UNIX) to check for duplicate schedules.
    If you see this issue also for jobs you execute manually (via webadmin or Designer), you can have this kind of problems if the same jobserver is registered multiple times in a repository. You can check the AL_MACHINE_INFO in your repository. It should have one line for each jobserver and one line for each administrator the repo is connected too. I suspect you have some duplicates there (you can just remove them - this table gets populated when adding a repo in the web admin and when adding a repo to a jobserver in the server manager).

  • JSP for executing scripts

    Hi
    Is it possible for jsp to execute shell scripts which connects the remote host .
    For example if i have a script which first connect to remote host ,fetch data from the host and give result back.
    Simply want to know if jsp can execute these shell scripts also or not.
    Thanks

    I donot think so that my question make less sense .Yes i know that JSP is run on server side .Remote host (to explain you better) means another server.
    I have a script which connect another server whenever it is run .The script is running properly when run from command prompt .
    JSP page can run shell scripts(which contains simple commands like ls ,ps , so on....) But when this particular shell script which connect another server to get result ,is executed through JSP did not work.
    Hope this make sense to you

  • Revenue recognition has been executed twice

    HI all
    G/L Balance is not correct as below.
    It looks that some of revenue recognition has been executed twice. There are both items that revenue recognition has been executed twice and items that revenue recognition has been executed once within the same sales order.  I have no idea whether there is any pattern exists or not.  This issue needs to be solved by today .
    what could be the reason, can any one help me on this.
    Thanks in advance,
    Raju

    Hi Raju,
    Can u explain us in detail,
    It can be the reason like if the revenue recog is replicating through some nightly job, there r different cases it may ran twice(relication has done twice).
    Best regards
    Bhupathi.

  • Init() method is executing twice

    Hi,
    I have a servlet & implemented the init() method. But, the init() method is executing twice.
    Also, the destroy() method is executing twice.
    Any input guys.
    Thanks

    JAXMServlet most certainly IS an HttpServlet - the javadocs that I see say it extends HttpServlet. It won't be very useful in a SOAP implementation if it's not.
    I thought the SingleThreadModel interface. Why? I thought that was a bad practice that was discouraged. What writable data members does this "test" servlet have that require such careful treatment? If your servlet implements doGet and doPost methods, with only local variables, it'll be thread-safe enough.
    I follow the Sun Java coding standards, even for dash-off classes. "test" should be capitalized. Is there no more descriptive name you can think of?
    I'm not aware of a problem with Tomcat, and I haven't checked the bug list. But I'd put my money on your code being the problem here. Do you call super.init() in your servlet's init() method? Maybe you're seeing the superclass init() being called?
    %

  • ActionPerformed-method executed twice...

    Please help!
    My program behaves strangely; the actionPerformed method on a button is executed twice. The first execution completes the method as it should and makes changes to the model as it should. Then there comes the second execution triggered BY THE SAME BUTTON AT THE SAME TIME as the first execution. How is this possible? And how to fix things? There are no external triggers to the button.
    Here is the example code showing the method actionPerformed and the output that it prints.
    * Method to run when an answer is selected
    public void actionPerformed(ActionEvent arg0) {
    // Printout info on the action
    System.out.println("EKO actionPerformed-method at beginning. Game level " + mymodel.getLevel());
    System.out.println("EKO action command: " + arg0.getActionCommand());
    System.out.println("EKO action was: " + arg0.ACTION_PERFORMED);
    System.out.println("EKO action time: " + arg0.getWhen());
    // Disable buttons
    enableButtons(false);
    // Call method setVastattu to notify the observers that an answer
    // has already been selected (e.g. probressBar needs to be stopped)
    mymodel.setAnswered();
    if (arg0.getActionCommand()==mymodel.getKysymys()[1])
    System.out.println("EKO answer was correct. Game level " + mymodel.getLevel());
    // Call a method to set new choice texts on the buttons and to set the game level one higher
    mymodel.levelUp();
    System.out.println("EKO after levelUp-method. Game level " + mymodel.getLevel());
    else {
    JOptionPane.showMessageDialog(this, "Wrong answer!");
    mymodel.setWrongAnswer();
    EKO actionPerformed-method at beginning. Game level 1
    EKO action command: Kuurupiilo
    EKO action was: 1001
    EKO action time: 1133534802433
    EKO answer was correct. Game level 1
    EKO levelUp method is setting game level to level 2
    EKO after levelUp-method. Game level 2
    EKO actionPerformed-method at beginning. Game level 2
    EKO action command: Punahilkka
    EKO action was: 1001
    EKO action time: 1133534805567
    EKO answer was correct. Game level 2
    EKO levelUp method is setting game level to level 3
    EKO after levelUp-method. Game level 3
    EKO actionPerformed-method at beginning. Game level 3 <= WHY AGAIN???
    EKO action command: Punahilkka <= SAME ACTION HAS ALREADY BEEN HANDLED
    EKO action was: 1001 <= SAME ACTION HAS ALREADY BEEN HANDLED
    EKO action time: 1133534805567 <= EVEN THE ACTION TIME IS THE SAME...

    WOW!
    Exactly! I indeed had the actionlistener added twice. I did not even know that it is possible to have several overlapping actionlisteners! Now my code works fine. Thank you very, very much!
    Elisa

  • Servlet being executed twice

              Hi all,
              I'm running WLS5.1, SP8 on W2K. I've written a servlet that instantiates and persists an entity bean. The servlet is registered in web.xml and mapped appropriately. If I run the servlet through the browser, everything works as expected.
              I've written a test case that opens a HttpURLConnection to the servlet, and instead of posting the data from a form (like through the browser), I appended the parameters to the querystring. When the test case executes, the servlet is executed twice, creating two identical rows in the database. So my test case fails expecting the entity to be unique.
              I see two servlet inits happening:
              <WebAppServletContext-vivaceApp> RequestProcessor: init
              and
              <ServletContext-General> classes: init
              Any ideas why this request is submitted twice?
              -EC
              

    What you might want to do instead of sending email directly from the trigger, is create a job which sends the email. This way you make the sending of the email part of your transaction. When you issue a commit, the job gets submitted and the email is sent. When you rollback, the job is removed and no email is sent.

  • Safari 3.2.1 on Leopard single call to cause Oracle report execute twice

    We have a web application that uses javascripts window.open(url) to call an Oracle rdf report and displays report result in pdf format. For unknown reason, the Oracle report got executed twice when only called once from Safari. It only happens in Safari 3.2.1 on Leopard, not in Safari on Tiger. Can you please shed some lights on how Safari works in this matter? Thank you very much, Steve

    Hi Steve,
    It's going to be impossible for anyone to debug with such limited information
    You're more likely to get some JavaScript experts chipping in if you can post some good examples of the code to demonstrate the problematic parts.
    Have you tried running the same code in Firefox with the Firebug extension to confirm the logic is functioning correctly? It's possible that Firebug might indicate where things are going wrong but for whatever reason the bug isn't exposed in Firefox.

Maybe you are looking for