How to add timeout for threads which are running  using ThreadPoolExecutor

I am trying change my existing functionality with ThreadPoolExecutor. I was unable to achieve fully.
Here is my issue.
I was creating multiple threads for independent DB update operations. And was calling join with time value on the each thread, for any reason if the db update hangs so that thread should die.
Now am trying use a nice ThreadPoolExecutor so that it can run and queue the threads nicely. But how do I create the timeout values for the threads which are in the ThreadPool. For any reason if the thread hangs then timeout will take care of killing the thread. When we use execute method submit the runnable task its not guaranteed that thread will run immediately. So when the executor will execute the submitted task is not know.
Probably I might be wrong some where.
Thanks.

Future task = threadPoolExecutor.submit(...);
//this will block until it finishes or times out.
task.get(REQUEST_TIMEOUT, TimeUnit.MILLISECONDS);

Similar Messages

  • How can I get INSTID_B for the documents which are stored using Store Business Document functionality

    Dear experts,
    I had activated the functionality of Store Business document and successfully stored documents in external server.
    My client have a custom function module which is used to send emails.In that FM they used SO_DOCUMENT_READ_API1, SO_DOCUMENT_SEND_API1 function modules.They passed Instance Ident(SRGBTBREL->INSTID_B)(eg: FOL33000000000004EXT39000000000026) as export parameter to the FM 'SO_DOCUMENT_READ_API1' and get the attachment details and content.
    Here my problem is I do not have entries in the table SRGBTBREL for the documents which are stored using the Store Business Document functionality and without INSTID_B I am unable to use the FM 'SO_DOCUMENT_READ_API1' to get the document details and content. Please help me to find INSTID_B for documents which are stored using Store Business Document functionality or please let me know if there is any other way to use FM 'SO_DOCUMENT_READ_API1' for documents which are stored using Store Business Document.
    Thanks in advance.
    Regards,
    Kiran

    Hi Kiran,
    You can use the following method to get the information. For example if you want to get BO documents for a customer
    CALL METHOD cl_binary_relation=>read_links
       EXPORTING
         is_object           = ls_lpor
         it_relation_options = lt_relat
       IMPORTING
         et_links            = lt_links.
    then fill  ls_por-instid with a customer number (KUNNR), ls_por-typeid = 'KNA1' and ls_por-catid = 'BO'.
    Table  lt_relat should contain a line option  for each document type (for example 'I' 'EQ' 'NOTE', 'I' EQ 'ATTA', 'I' EQ 'URL', ...
    In table lt_links you will get your information.
    Maybe some other methods of class CL_BINARY_RELATION may also solve your issue.
    Regards,
    Klaus

  • How can I find the profiles which are not in a role

    Hi all,
    how can I find all profiles which are not used in a role. Its important for a security check.

    Hi Stefan,
    you do one thing use the transaction SUIM
    SUIM>>Profile>>By Roles
    give all the role name and execute you will get roles with profiles
    and extract to excel sheet
    to get only profiles
    suim>>profile>>by profile name or text give * and execute
    and extract in excel sheet no compate profile coloumns get the profiles which does not there in any roles
    hope ds helps
    thanks
    kishore

  • How to save my bookmarks in a protected folder(google has an add on for favorits which will never be deleted) in case of harddisk format or computer crashdown?

    how to save my bookmarks in a protected folder(google has an add on for favorits which will never be deleted) in case of harddisk format or computer crashdown.

    The built-in Firefox Sync service allows you to store your settings, including bookmarks, on a Mozilla server. This isn't accessible as a file like Google Drive; it can only be used by connecting another copy of Firefox to your Sync account. You can read more about this here: [[How do I set up Firefox Sync?]] (I haven't tried it myself since it changed recently.)
    The cross-browser Xmarks service is more focused: it just does bookmarks. http://www.xmarks.com/ (I've never tried this one either)
    If you prefer working with files and you have a Dropbox or similar account, you could in theory back up your Firefox profile folder, or more particularly, the bookmarkbackups subfolder. I haven't tried that myself. To find the folder:
    Open your current Firefox settings (AKA Firefox profile) folder using either
    * "3-bar" menu button > "?" button > Troubleshooting Information
    * Help menu > Troubleshooting Information
    In the first table on the page, click the "Show Folder" button
    A window should launch showing your currently active settings files. The bookmarkbackups folder should contain dated .json files which can be used to restore your bookmarks to another copy of Firefox.
    Alternately, someone might have created an add-on for saving Firefox bookmarks to the cloud another way, but I haven't heard of one.

  • Batch Split for Material which are activated with serial number management

    Hello All,
    We have requirement where we want batch split to be mandatory during goods reciept with inbound delivery  for material which are serial number managed.
    Please let me know the possible solution to achive this requirement.
    Appreciate your quick response.
    BR,
    Tushar

    I have resolved this issue by myself. Check out the link where I have briefed how to resolve the issue using bapi BAPI_OUTB_DELIVERY_CHANGE.
    BAPI_OUTB_DELIVERY_CHANGE - Batch Splits don't work
    Regards,
    Senthil G.

  • How to add an issue if you are a responsible manager of a child wbs ?

    How to add an issue if you are a responsible manager of a child wbs ? I have some projects with lots of child WBS and these child WBS is managed by others project managers (or others responsible managers), different responsible manager from the project. I'd like the others responsible managers could add/edit/delete issues in their WBS's. How to do that ?

    Hi Yves
    try to type at the end of your query the following
    select cardcode,cardname,balance from ocrd
    for browse
    and execute it again
    Edited by: Fasolis Vasilios on Nov 30, 2011 12:10 PM

  • How to add services for object in ECC6.0

    Hi everybody,
                        Can anybody tell me how to add "Services for Object" icon in ECC 6.0 because this icon is there in 4.6C but not coming in ECC 6.0.
    Thanks in Advance

    Hi Saurabh,
                Thanks for your reply. I have checked the path given by you...System-> Service for object, but it is showing no service available as told by you. Cud you please tell me how to add this service because this is working fine in 4.6C but I dont know how to add these services in ECC 6.0. If any code for this which is written in 4.6C which I can refer... please tell me where to see the code for adding services (in 4.6C)  b'coz its very urgent.

  • How to get the  Checked box which are clicked

    for(int k=0;.....
    jsp code
    <input type=checkbox name=checkbox value='<%=k%>' >
    how to get the particular Checkbox which are checked???

    String[] checkedValues = request.getParameterValues("checkbox");You'll get an array filled with the values only for the checked boxes. In other words, if no boxes are checked, checkedValues will be null or checkedValues.length == 0, not sure, going from memory.
    Hope this helps!
    Patrick

  • How to sort on MULTIPLE Keys which are elements of VO's stored in  list

    How to sort on MULTIPLE Keys which are elements of VO's stored in a list.. without disturbing the ordering done by previous sorting...?
    Is there any best soln for the same...
    Thanks..

    How to sort on MULTIPLE Keys which are elements of
    VO's stored in a list.. without disturbing the
    ordering done by previous sorting...?Do you mean you want to do a heirarchical sort? Where the secondary key is only used when the primary keys are equal etc.? That's pretty trivial. If the primary keys are equal, check the secondary key. How do you sort words in alphabetical order? It's the same process.

  • How can we find delivery documents which are not goods issued?

    Hi All,
    How can we find delivery documents which are not goods issued?
    Thanks in advance

    hi,
    please check in VL06O.
    there will be plenty of options on the same.
    you are requested togo for push button FOR GOODS ISSUE from there u will go to VL06G only
    your requrient will be satisfied.
    regards,
    balajia
    Edited by: balaji timmampalli achari on Nov 11, 2010 12:39 PM
    Edited by: balaji timmampalli achari on Nov 11, 2010 12:40 PM

  • How to get services which are running currently

    How to get services which are running currently in the system by a java program. And also how to write a service so that i can start/stop the service from the control panel -> services.

    triple post
    http://forum.java.sun.com/thread.jsp?forum=31&thread=364090&start=0&range=15#1532232
    http://forum.java.sun.com/thread.jsp?forum=31&thread=364088&tstart=0&trange=15

  • Itunes was reinstalled on my MacAir and in the process my playlists disapeared. How can I sync theses playlists which are still on my Ipod back to the iTunes library? PS: these are not purchased from iTunes, they are my own cd's.Thanks.

    Itunes was reinstalled on my MacAir and in the process my playlists disapeared. How can I sync theses playlists which are still on my Ipod back to the iTunes library? PS: these are not purchased from iTunes, they are my own cd's.Thanks.

    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • My HD TV has two HDMI inputs which are being used by a home theater system and my RCN cable box. i want to be able to use my appleTV as well as those but do not have another HDMI input. How can i connect it so that i can use any 1 of the 3 at any time?

    My HD TV has two HDMI inputs which are being used by a home theater system and my RCN cable box. i want to be able to use my appleTV as well as those but do not have another HDMI input. How can i connect it so that i can use any 1 of the 3 at any time?

    Get an HDMI switcher. Plug in the ATV directly to the TV and then use the switcher on the other input.
    Example
    http://www.amazon.com/Ultra-High-Performance-Switcher-Switch/dp/B0015YWKYY/ref=s r_1_1?ie=UTF8&qid=1316918064&sr=8-1

  • How can I send scanned files, which are documents changed from doc to PDF, as documents that can be edited if the recipient doesn't have Adobe capabilities?

    How can I send scanned files, which are documents changed from doc to PDF, as documents that can be edited if the recipient doesn't have Adobe capabilities?

    Hi flaviusjack,
    If you still have the .doc files, it might be best to send those to your recipients so they can be edited. Otherwise, you can use ExportPDF to convert the PDF files back to .doc format. But, again, that step would be unnecessary if you have the .doc files.
    Best,
    Sara

  • How to differentiate between 2 exceptions which are same(Ex: IOException)

    how to differentiate between 2 exceptions which are same(Ex: IOException)
    but occurring in 2 different functions(Ex: one in systemSoftwareProvisioning()
    and other one in provision() ). How to differentiate between them and in the
    framework how to catch both of them separately

    also use throwable.printStackTrace() method, this will point the line no. of the java file where the exception occured

Maybe you are looking for

  • SAP message Log

    Does SAP maintain log of all the messages displayed on screen using MESSAGE statement? We are investigating a problem and want to see the messages displayed by SAP during the time when problem occured.

  • Adobe in Design CS6 crashes when exporting to pdf

    I am running MAC OSX version 10.8.5 and every time i am trying to export a pdf from inDesign CS6 is chrashing. And i am doing the same loop again and again with the same results. The inDesign file is large (<8gb) and most of the items inside are embe

  • Max number of connections

    What is the Maximum number of wireless connections to a WRT160Nv2 router?  I currently have 4 wireless devices and one wired.  I am trying to add another camera.  If it is maxed out, what router would you recommend for 10 devices? Thank you in advanc

  • Questions on Patitioning table

    Hi, I am using Oracle 10g and my application is an ETL application where i am getting bulk data from various transactional systems every month and i am loading them into a base table, aggregate table and reporting table. I wanted to know somethings a

  • Reset the master password through applescript

    I understand that the correct procedure to reset the master password is to delete these two files from the computer: /Library/Keychains/FileVaultMaster.cer /Library/Keychains/FileVaultMaster.keychain The next step is to go into system preferences and