ScheduledExecutorService.scheduleAtFixedRate executes more than it shouldI

Hi,
I have the following problem, that I hope you can help me resolve (or investigate):
ScheduledExecutorService scheduledExecutorService= Executors.newScheduledThreadPool(4, new NamedThreadFactory("MyWorker-"));
scheduledExecutorService.scheduleAtFixedRate(new FinalJobsCleanerTask(),0,1,TimeUnit.HOURS);That code should implement a schedule that wakes every hour and runs the given task.
For some reason, I see from time to time, that it wakes up more that it should- looking at the log, I see that one time the same Thread ('MyWorker-1' for example) executed the task for about 10 time at the same second (with some ms difference between each execution). I know for sure that the FinalJobsCleanerTask() is not invoked by any other executor, so obviously it is something wrong with the way I use the ScheduledExecutorService.
Do you have any idea what may cause this problem? Any clue will be appriciated :-)

If that doesnt work then something in your code is causing it to loop more than once, or the system clock is changing.

Similar Messages

  • Execute more than one thing at the same time.

    Hey why every time i want to execute more than one thing(create tables) at the same time
    it say "ORA-00911: invalid character" , i dont wanna execute one thing at a time. check the pic please
    http://img370.imageshack.us/img370/5120/oraclesw5.jpg
    but in my school i use something called isqlplus and i can execute all the things i want at the same time with-out any error.
    im using right-know
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production

    1) Unless you are using something like DBMS_JOB, SQL*Plus, iSQL*Plus, the Oracle XE web-based front-end, or any other application is going to execute one SQL statement at a time.
    2) There is a dedicated XE forum-- the folks over there might know how to run a script using this particular front-end.
    3) Assuming the XE database is on your local system, you should be able to log in via SQL*Plus and use that utility to run your scripts.
    Justin

  • Performance... Why a function column in a view is executed more than once...?

    Why a function column created inside a view is executed more than once when called more than once?
    EXAMPLE:
    create or replace view aux1 as
    date_column,
    any_function(date_column) column1
    from any_table
    create or replace view aux2 as
    column1 c1,
    column1 c2,
    column1 c3
    from aux1
    select * from aux2
    It will execute 3 times the function any_function... logically the value will be the same for all columns...
    I understand why!... are 3 calls... but...
    Why not to create a "small" verification and if the function column was execute replace the second, the third... value? ... instead of execute 3, 4... times...
    tks
    Braga

    Actually, this is more than a performance issue. This is a consistency problem. If the function is NOT deterministic then you may get different values for each call which is clearly not consistent with selecting 3 copies of the same column from a row. Oracle appears to have fixed this in 9i...
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.2.0 - Production
    create view v1 as select dbms_random.value(1,100) r from dual;
    create view v2 as select r r1, r r2 from v1;
    select * from v2;
              R1           R2
              93           74
    Connected to:
    Oracle9i Enterprise Edition Release 9.0.1.3.0 - Production
    With the Partitioning option
    JServer Release 9.0.1.3.0 - Production
    create view v1 as select dbms_random.value(1,100) r from dual;
    create view v2 as select r r1, r r2 from v1;
    select * from v2;
              R1           R2
              78           78Richard

  • Executing more than one procedures at a time

    Hi,
    Can any one tell how to execute more than one procedure at a time..
    I am trying to run like this..but its throwing an error...can anyone please suggest?
    CREATE OR REPLACE PROCEDURE HYSXM.QA_AUTO_RETURN_FINAL IS
    i EVENTS_TEST_DATA%ROWTYPE;
    BEGIN
    DELETE FROM TEST_EVENTS;
    COMMIT;
    for i in ( SELECT RADIO_ID,EVENT_TYPE FROM EVENTS_TEST_DATA )
    LOOP
    QA_AUTO_INSTALL(i.radio_id,i.event_type);
    QA_AUTO_RESOLD(i.radio_id,i.event_type);
    QA_AUTO_RETURN(i.radio_id,i.event_type);
    END LOOP;
    END QA_AUTO_RETURN_FINAL;
    /

    what error message is being returned??

  • Prepared statement st in servlet - not executing more than once!

    Hi,
    my problem is that the following piece of code in a servlet does not get executed more than once:
    myQuery = "DELETE FROM MREMINDERS WHERE username=? AND reminders=?";
    PreparedStatement st = conn.prepareStatement(myQuery);
    st.setString(1,usern);
    st.setString(2,oldRem);
    st.executeUpdate();
    st.close();
    The above code is called in a servlet to delete fields from a table. I call this code in a for loop from another method in the servlet. It executes the first time in the loop, but the second time onwards it throws an error!!! please let me know how to solve this ASAP since i am at the point of frustration now!!!
    thanx...

    Hi,
    sorry... i got it fixed!!!! :-)
    i was closing a JDBC connection which was generating that error!!
    thanx again..

  • Business rules in 11.1.1.3 execute more than once

    My client has the situation where certain business rules (launched from the Planning BR interface) will execute more than once, sometimes twice or even three times. It seems that the rule will start to execute and then after 1 or two minutes, will launch again. the job console will show the information.

    This is a known issue and has to do with the http timeout settings. Usually this will happen on the 5 minute limit, but it depends what setting they have.
    Take a look at this article and see if it applies:
    Business Rules That Take More Than Five Minutes to Execute Are Re-launched Repeatedly [ID 755406.1]
    Agnete
    Edited by: Agnete on Oct 22, 2012 12:51 PM

  • My MacBook Pro is really hot and the fan is on constantly. It didn't use to do this, does anyone know why this is happening? I have a very short battery life, so I have to keep it plugged in probably more than I should.

    My MacBook Pro is really hot and the fan is on constantly. It didn't use to do this, does anyone know why this is happening? I have a very short battery life, so I have to keep it plugged in probably more than I should.

    Open Activity Monitor in the Utilities folder.  Select All Processes from the Processes dropdown menu.  Click twice on the CPU% column header to display in descending order.  If you find a process using a large amount of CPU time, then select the process and click on the Quit icon in the toolbar.  Click on the Force Quit button to kill the process.  See if that helps.  Be sure to note the name of the runaway process so you can track down the cause of the problem.

  • How to prevent executing more than one client from a machine?

    Hi all,
    Currently I am doing a client server project in java. The client is java swing. There is a requirement to prevent executing more than one client from a machine.
    Now I am relying on socket for this. I listen to a port, say 15000 and when the second session is started it would give an exception at the socket. I know that this a trivial method. Can anybody please suggest a better method. Also is it possible to bring focus to already executing client, if the user tries to execute the client program again in the same machine?
    An early answer to this question is highly appreaciated.
    Thanks in advance
    SSM

    Thanks for the suggestion, but I dont think we can use socket for this. And again if we use file for the same as you described, I think it would sometime create a some serious side effects. Suppose after one client session is invoked, the power goes off. In this case the client shut down is not in the normal sequence and hence we cannot remove the file programaticaly. This creates big problem when the user tries to run client again.
    I am really interested to know, is there any standard way in java which can be used to achieve this. Also is it possible to give focus to already executing client program if the user tries to invoke the client again.
    Thanks
    SSM

  • Execute more than 1 function from process code IDOC

    Hello,
    Is it possible to execute more than 1 function via process code of an IDOC?
    I am talking about inbound IDOC.
    Sara

    Hi Sara,
    What is the exact requirement.
    Regards,
    Madhu.

  • Execute more than one times external command of OS Windows NT

    Hi all,
            I have to execute more than one times from an ABAP program an exernal command of Operating system windows NT . In order to reach this goal I found the standard program RSBDCOS0 and it works very well if you execute it one time.  Unfortunately I have to execute this external command more than one times. Is there any soluiton?
    thank to all
                        Gino Bonfiglioli

    Well why are you using this report RSBDCOS0 to execute external commands?
    Because SAP provides certain function modules that can be used to call operating system commands; so you can use these functions to do your task.
    Just check the following link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fa/0971e1543b11d1898e0000e8322d00/frameset.htm
    As you mentioned that you need to execute multiple times, you can easily put the call to function module inside a loop or do/enddo structure. for example consider the following
    do 3 times.
    call function 'SXPG_COMMAND_EXECUTE'                           
          exporting                                                 
               commandname                   = 'Put operating system command here'          
               additional_parameters         = full_filename        
               targetsystem                  = targtsys  
               stdout                        = 'X'                  
               stderr                        = 'X'                  
               terminationwait               = 'X'                  
          importing                                                 
               status                        = sxpg_status          
               exitcode                      = sxpg_exitcode        
          tables                                                    
               exec_protocol                 = sxpg_results         
          exceptions                                                
               no_permission                 = 1                    
               command_not_found             = 2                    
               parameters_too_long           = 3                    
               security_risk                 = 4                    
               wrong_check_call_interface    = 5                    
               program_start_error           = 6                    
               program_termination_error     = 7                    
               x_error                       = 8                    
               parameter_expected            = 9                    
               too_many_parameters           = 10                   
               illegal_command               = 11                   
               wrong_asynchronous_parameters = 12                   
               cant_enq_tbtco_entry          = 13                   
               jobcount_generation_error     = 14                   
               others                        = 15.                  
    write the results
    loop at sxpg_results.
    write:/ sxpg_results-length,
             sxpg_results-message.
    endloop.
    refresh sxpg_results.
    enddo.

  • Query executes more than once

    Hello All,
    We have crystal reports integrated in the java web application. Reports with parameters are executing query more than once (found in the SQL Server Profiler).
    Scenario:
    Report query with parameter :- select * from cieuser where id >= {?userId}.
    User provides value '1' to this parameter and selects report execution.
    Before executing the report, our system updates the database connection details of the rpt with other configured details.
    Issues:
    During updating of the database details on execution of statement "databaseController.setTableLocation(orig.getTable(i), table);" , the profiler shows:
    select * from cieuser where id >=  NULL
    And on executon of the statement "viewer.processHttpRequest(request, response, getServletConfig()
                  .getServletContext(), null);" the profiler shows the following:
    select * from cieuser where id >= {?userId}
    select * from cieuser where id >= 1
    select * from cieuser where id >= 1
    When the same report is executed from the standalone crystal designer, the profiler shows one time query execution:
    select * from cieuser where id >= 1
    Environment:
    Crystal reports designer - 11.5.10.1263
    JRC - 11.5
    Please advise.
    Thanks,
    Ratan.

    Hello,
    SAP decided to allow the confirmation of orders with a final confirmation (status CNF) deliberately. So it is possible to confirm work that was maybe forgotten or if the flag 'final confirmation' was set mistakenly. Only the status CLSD will prevent further confirmations.
    If you want forbid further confirmations of  orders with status CNF you can use enhancements CONFPM* or BAdI WORKORDER_CONFIRM. However, the probably easiest way is to define a user status that is set at business transaction 'Confirm order' and, once set, forbid business transaction 'Confirm order'.
    Regards,
    Reinhard

  • Can we execute more than one SQL in Stored Procedure?

    Please help me with this.
    I am connecting to SQL SERVER
    Thanks
    Venu

    Hi Venu,
    >>1) Get the input parametrs for SP in from file
    You can pass parameters to the SP from the payload of the message. I am not sure what do you mean by "Getting the parameters for SP in form file"..
    >>2 Configure Receiver JDBC adapter(Synchronous)which executes a STORED PROCEDURE that has some processing logic containing more than one sql statment
    This is no problem. You can have any number of select /update statements inside the stored procedure. But your stored procedure will not return data to XI and that will not be sent as a response to your BPM
    3) Send the response from SP to a BPM
    yes.You can have another Stored procedure that have only one select statement to send response to BPM. You may have to define abstract interfaces .
    hence for 2) and 3) the message payload would be something like this
    <StatementName1>
    <storedProcedureName action=” EXECUTE”>
        <table>realStoredProcedureeName</table>
    <param1 [isInput=”true”] [isOutput=true] type=SQLDatatype>val1</param1>
    </storedProcedureName > 
      </StatementName1>
      <StatementName2>
    <anyName action=” SQL_QUERY”>
    <access>SQL-String with optional placeholder(s)</access>
    <key>
      <placeholder1>value1</placeholder1>
      <placeholder2>value2<placeholder2>    
    </key>
    </anyName > 
      </StatementName2>
    Regards
    Arul
    PS: Mark usefull answers and for more info about points - read the post "Rules of engagement" at the top of the XI forum

  • Report is executing more than one hour

    Hi All,
    I have an issue with my report,its taking more than one hour for execution.
    This report is called through an package,in package there are cursors which retrive data and sends to mail.The problem is with this select statement in cursor,its taking a lot of time to retrive the data.
    In my cursor select statement i am using the following tables
    HZ_PARTY_SITES HPS,
    HZ_CUST_ACCOUNTS CUST,
    HZ_CUST_ACCT_SITES_ALL HCASA,
    HZ_CUST_SITE_USES_ALL HCSUA,
    HZ_LOCATIONS HL,
    OE_ORDER_HEADERS_ALL OOH,
    OE_TRANSACTION_TYPES_TL OT,
    OE_AUDIT_ATTR_DESC_V AADV
    when i use OE_AUDIT_ATTR_DESC_V ,its taking a lot of time to retrive.So any one can help me out in this issue,how to add this view to other tables
    Regards,
    RR

    RR,
    Before you add any indexes to the listed tables, check with Oracle support to ensure you will be violating your Oracle Enterprise Business Suite agreement. Oracle has specific rules on modifying EMS tables. Additionally, any EBS patch or update that gets applied will likely drop any custom changes to these tables. It might be better for you to open a Service Request with Oracle Support and have them tell you how to improve the performance of your query since all of your tables are EBS tables.
    Craig...
    Message was edited by:
    CraigB
    RR, you may also want to check with your DBA(s) to see when the Statistics were last gathered on these tables.

  • Paid more than i should have

    omg!! i paid way more than i was supposed to i didnt realize it until after i sent it... my bank says there might not be anything they can do beause i paid by credit card.. would verizon be able to stop the payment and refund so i can pay the correct amount??

    I believe they will tell her they can do nothing to help her and she is stuck.  Sadly, I just experienced their customer service in relation to a similar issue. And they will tell you they showed you a screen and you agreed to pay that amount. Even if you had entered a different amount in the amount you wished to pay,  I found very little sympathy or concern about their customer's billing issues.
    Please post an update, so we can see what they did for you.

  • How to execute more than one command in a Process

    Hello all,
    I would like to change the user in my application by
    using the unix command su user and then execute some commands as this user.My code is the following, my problem is to execute other commands after execute the su command.
    public static void main(String [] args)
    try
    Runtime r = Runtime.getRuntime();
    String msg = "";
    String emsg = "";
    int len = 0;
    byte buffer [] = new byte[100];
    Process p1 = r.exec(new String [] "su","user"});
    InputStream input = p1.getErrorStream();
    len = input.read(buffer);
    System.out.println(new String(buffer,0,len));
    OutputStream out = p1.getOutputStream(); String password = "password";     
    out.write(password.getBytes());
    out.flush();
    out.close();
    System.out.println(password);
    p1.destroy();
    catch(Exception e)
    System.out.println(e.toString());

    For those of you who are "shell challenged", here's a Java program that will tell you how the shell interprets the command and argument you give it:
    public class RuntimeHelper {
        public static void main(String[] args) {
            for (int i = 0; i < args.length; i++)
                System.out.println(args);
    When you run the program with
    java RuntimeHelper su username -c "cmd arg1 arg2"
    the output is:
    su
    username
    -c
    cmd arg1 arg2
    Each line shows one argument that the shell passed to the java command.

  • How to execute more than oracle scripts using sqlplus

    Dears,
    I have 10 scripts that create table ,need to execute scripts sequentially
    Example
    Ascript
    Bscript
    Cscript
    Dscript
    need to run scripts using sqlplus commands in one time

    user8929623 wrote:
    Dears,
    I have 10 scripts that create table ,need to execute scripts sequentially
    Example
    Ascript
    Bscript
    Cscript
    Dscript
    need to run scripts using sqlplus commands in one timeCreate a script like :
    @Ascript
    @Bscript
    @Cscript
    @Dscript

Maybe you are looking for

  • Memory Leak Problem at Adobe LiveCycle Server 9.0

    Hi All, We want to upgrade our system to 9.0. During the performance test we have found memory Leak problem at ALS 9.0. I explain the detailed problematic issue below. Is there any body who has any suggest? We have Adobe Livecycle ES2 9.0 SP2 install

  • 3G iPod Shows up on Desktop but not in iTunes

    I am having the same problem with my 3G iPod. It has been working flawlessly for many years but I tried to mount it and update my songs and it will show up on the desktop but not in iTunes. It does show up in the system profiler. I reset the iPod via

  • JavaScript files are not being updated while updating managed solution over Dynamics CRM Online

    Hi Support, While I am updating a managed solution over Dynamics CRM 2013 Online, JavaScript files are not being updated and is showing the source as of the last version of the managed solution.  I tried the same versions of solution on my CRM 2013 o

  • Issues after upgrading to 6.0

    Hi experts, After upgrading to 6.0 seems system overall is slow. Netflix app asks me for password everytime I open. Youtube buffering issues. I hope with software upgrade these issues might get resolved. But I could not able to install updates. I tri

  • Load Balancing with WLS 9.2.2

    Hi - We have an application that is deployed in a WLS cluster with a virtual IP/load balancer in front of the application. We have tried setting the FrontEnd HTTP Host and ports at the cluster level and at the individual server level but when we chec