Thread pool and use database table as queue

is this possible to use database table as queue rather than using "LinkedBlockingQueue"..and store in memory ? If yes, how do i serialized the task object into table and how to retrieve the task object back when need to be execute by executorservice..?

cometta wrote:
is this possible to use database table as queue rather than using "LinkedBlockingQueue"..and store in memory ? If yes, how do i serialized the task object into table and how to retrieve the task object back when need to be execute by executorservice..?From the sound of this I think BDLH is on the right track. I would think in terms of messaging with JMS. There is one potential pitfall you may have to work around. JMS does not guarantee the order in which messages will be extracted from the queue. If the order of messages is important that is a problem you'll have to solve.
PS.

Similar Messages

  • Can moving large sharepoint lists to database and using database table as an external list help performance?

    Hi All,
    I have to maintain a huge SharePoint 2010 list with more than 700,000 items in it. The items are data records(not documents) and are distributed among a number of folders. There are also a number webparts that are currently using this list. As you can imagine
    the performance of queries on the list have degraded considerably. Even opening the folders with too many items in them takes quite some time. We are looking for a solution for this situation and some people suggested to move the list items to a SQL Server
    table and make an external list representing the original list. They think this way the changes that we have to make in the webparts source codes will be minimal.
    I am not sure if this is the best solution as I have heard about slow external lists. Do you think using the external list instead of our current list improves the performance? Do you think this is the right solution for us?
    I would be grateful if you tell me your ideas to solve this problem.
    Thanks in advance

    "right solution for us" is hard to solve without more info.
    SharePoint list items can include things like version history, content approval, audit tracking, and more... such things are NOT built into SQL.
    BCS is an option, and generally changing a list CAN have a very minimal impact (making many assumptions about how it's used)...
    BCS also incurs an overhead of the lookup (since it's external). And there are record limits (defaults at a minimum).
    And more importantly, SharePoint *can* handle large lists... if done appropriately... but can also be mis-handled.
    The limits imposed on large lists by SharePoint, are largely attributable DIRECTLY BACK TO SQL (specifically, the number of records that can be obtained with ROW locks before switching to PAGE locks or TABLE locks, which have LARGER impacts).
    So again, BCS is an option, but whether it's the "right solution for us" is more dependent. Plus, you would probably also benefit by spending some time investigating the other uses (web parts/etc) for opportunities to improve their performance,
    user experience, etc.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Use database table in different system?

    Hi, experts,
    I am new to WD. I have a question here:
    For example, now my WD application is in IB* system and the database table I need is in IS* system. I want to create functions in IB* system to operate the data from database table in IS* system and I will then use BAPI to call the created functions to transfer the results to WD. Is this possible?
    Best Regards
    Fan

    Hi, Jagdish,
    thank you for your reply. Do I need to do anything special to call the function module in another system? Or the WD wizard of making service call will automaticlly identify the position of the needed function module after i specify the name of the function module?
    Best Regards
    Fan

  • Difference between using app server connection pooling and using the driver

    Hi all,
    How to get connection pooling with out application server and tomcat also?
    What is the difference between using app server connection pooling and using the driver supported connection pooling?
    Regards,
    Murali

    maybe the performance of App server pool is better than the JDBC pool,
    for you don't know wether the implementation of the JDBC interface is good or bad.

  • Best way to declare and use internal table

    Hi all,
    As per my knoledge there are various techeniques (Methods) to declare and use the internal tables.
    Please Suggest me the Best way to declaring and using internal table ( WITH EXAMPLE ).
    Please Give the reason as well how the particular method is good ?
    What are benefits of particular method ?
    Thanks in advance.
    Regards
    Raj

    Hello Raj Ahir,
    There are so many methods to declare an internal table.
    Mainly I would like to explain 2 of them mostly used.
    1. Using Work Area and
    2. With header line.
    This with header line concept is not suggestable, because, when we shift the code to oops concept.. it doesn't work... Because OOPS doesn't support the Headerline concept...
    But it all depends on the situation.
    If you are sure that your program doen't make use of the OOPs concept, you can use HEADER LINE concept. If it invols OOPs use WORK AREA concept.
    Now I'l explain these two methods with an example each...
    1. Using Work area.
    TABLES: sflight.
    DATA: it_sflight TYPE TABLE OF sflight.
    DATA: wa_sflight LIKE LINE OF it_sflight.
    SELECT *
      FROM sflight
      INTO it_sflight
      WHERE <condition>.
      LOOP AT it_sflight INTO wa_sflight.
        WRITE / wa_sflight.
      ENDLOOP.
      In this case we have to transfer data into work area wa_sflight.
    We can't access the data from the internal table direclty without work
    area.
    *<===============================================
    2. Using Header line.
      DATA: BEGIN OF it_sflight OCCURS 0,
              carrid LIKE sflight-carrid,
              connid LIKE sflight-connid,
              fldate LIKE sflight-fldate,
            END OF it_sflight.
      SELECT *
        FROM sflight
        INTO it_sflight
        WHERE <condition>.
        LOOP AT it_sflight INTO wa_sflight.
          WRITE / wa_sflight.
        ENDLOOP.
    In this case we can directly access the data from the internal table.
    Here the internal table name represents the header. for each and every
    interation the header line will get filled with new data. If you want to
    represnent the internal table body you can use it_sflight[].
    *<======================================================
    TYPES: BEGIN OF st_sflight,
             carrid LIKE sflight-carrid,
             connid LIKE sflight-connid,
             fldate LIKE sflight-fldate,
           END OF st_sflight.
    DATA: it_sflight TYPE TABLE OF st_sflight,
          wa_sflight LIKE LINE OF it_sflight.
    This is using with work area.
    DATA: it_sflight LIKE sflight OCCURS 0 WITH HEADER LINE.
    This is using header line.
    <b>REWARD THE POINTS IF IT IS HELPFUL.</b>
    Regards
    Sasidhar Reddy Matli.
    Message was edited by: Sasidhar Reddy Matli
            Sasidhar Reddy Matli

  • Validation by using Database Table Values

    Dear Experts,
    Please suggest us how can we validate the user input values with our database table values in ADF.
    thanks in advance
    Shiv Naresh

    Take a look at Edwin Biemonds blogpost.
    Using database tables as authentication provider in WebLogic
    http://biemond.blogspot.de/2008/12/using-database-tables-as-authentication.html

  • On Threads, Pools and other beasts

    I'm seeing some unexpected behaviours in our production system relating to
    (AFAICS) threads and connection pools, and hope you could bring some info
    about them.
    Our system is built over 4 PIII Xeon processors under Linux.
    We do currently have this configuration:
    15 threads for the "default" queue and 10 for an special servlet one, we
    decided to separate threads in two queues in order to assure our users get
    always a thread besides what the rest of the system is "doing".
    Even we do not have a lot of users (about 20 or so) they do generate a lot
    of load as for the bussiness logic inherent to the application.
    For sample, so you can understand what goes with practically any user
    "action", think on this.
    After a user "confirms" some data via a servlet and after executing the data
    validation and bussines rules some messages are sent via JMS to the
    "asynchronous" part of the system (that is running in the same weblogic
    instance). After commiting the user transaction an thus releasing the
    servlet thread, so it can be used by the same or other user, JMS messages
    are delivered to MDBs that must transform information from on-line (servlet)
    processes in different ways so they can be stored onto other systems, i.e.
    into a mainframe, into an XML DB and possibly into another RDBMS. Our
    configuration is that there can be as much as 10 MDB of each type (I mean
    for each kind of "action" of a servlet) running concurrently and as you can
    suppose those processes do take some time to communicate with destination
    systems and perform their work.
    We end at last with a lot of concurrent processes in our system that ends
    some time with the users complaining about system responsiveness.
    After all this explanation I would like to know if 25 threads for
    "background" and on-line processes is too low (as I'm afraid they are). The
    problem is we can't seem to increase the number of threads without being
    very careful with JDBC connection pools.
    Currently we have two connection pools. We do demarcate transactions in the
    clients (servlets, batch processes) we have a "transacted" pool and a "non
    transacted" one.
    We are delegating persistence to the contanier (formally in our case we are
    using TopLink persistence and it uses in it's deployment descriptor both
    types of pools)
    Our configuration is as follows:
    Oracle pool NON Tx 60 connections
    Oracle pool Tx 30 connections
    initially we create 5 connections for each pool with an increment of 5 for
    each one too.
    From the tests I have made I have discovered that setting more threads than
    the minimum amount of pools yields to this exception:
    weblogic.common.ResourceException: No available connections in pool
    myNonTxPool
    at
    weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.java:57
    8)
    at
    weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.java:40
    5)
    at
    weblogic.common.internal.ResourceAllocator.reserveNoWait(ResourceAllocator.j
    ava:373)
    at
    weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:165
    at
    weblogic.jdbc.common.internal.ConnectionPool.reserveNoWait(ConnectionPool.ja
    va:126)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiDataSource.
    java:194)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java
    :219)
    the behaviour I would expect is that in case a thread needs a connection and
    there isn't any one available the thread may be blocked and it would receive
    the connecion once one is released, of course as I can see in the stack the
    ConnectionPool.reserveNoWait() method is behaving just the other way.
    The main problem with this is that as you can see we are "forced" to spend
    90 (60+30) connections to the DB (even we will never use more than 25
    (15+10) simultaneously just because we must assure that at least there is
    one "reserved" connection to each thread.
    Our DBA thinks that it can't be possible that we spend such number of
    connections that could be taken by another application(s) (as the DB is
    shared with other apps)
    Currently our DB system is not set as "multithreaded" so each connection
    created against the DB is a process on the system and of course they are a
    really scarce resource.
    My question is. What would be a "fine" number of threads for an application
    like this that is mainly "background-batch processing" but assuring on-line
    users have their threads always available?
    I have just another doubt (maybe this is not the right thread to ask for it
    but...) how does the UserTransaction actually works? I mean, is the
    connection given to the thread (and thus extracted from pool) as soon as the
    thread begin it's work? or is it given in the instant of "commiting" to the
    DB. I know maybe using TopLink changes default Weblogic CMP behaviour but I
    would like to know what the "default" Weblogic behaviour is; and, what
    happens when you don't start a transaction in the client and total execution
    time exceeds 30 seconds? I have seen a rollback due to "exceeding" those 30
    seconds althought I'm sure we do not open any transaction, what kind of
    "transaction" is that? Is just a way of Weblogic to assure a thread is not
    "locked" more than a certain period of time so the system never "stalls"?
    Thanks in advance.
    Regards.
    Ignacio.

    Hi Ignacio,
    See my answer inline.
    "Ignacio G. Dupont" <[email protected]> wrote in message
    news:[email protected]...
    I'm seeing some unexpected behaviors in our production system relating to
    (AFAICS) threads and connection pools, and hope you could bring some info
    about them.
    Our system is built over 4 PIII Xeon processors under Linux.
    We do currently have this configuration:
    15 threads for the "default" queue and 10 for an special servlet one, weThat numbers defines number of concurrent requests services
    associated with that queues can handle. If monitoring CPU utilization
    shows that CPU load is not high, let say less than 90%, - you can increase
    that numbers.
    decided to separate threads in two queues in order to assure our users get
    always a thread besides what the rest of the system is "doing".
    Even we do not have a lot of users (about 20 or so) they do generate a lot
    of load as for the bussiness logic inherent to the application.>
    For sample, so you can understand what goes with practically any user
    "action", think on this.[eaten]
    We end at last with a lot of concurrent processes in our system that ends
    some time with the users complaining about system responsiveness.You will have to run a load test in your QA environment and play with queue
    sizes. In addition, you may want to run a profiler (like JProbe or
    OptimizeIt)
    for maximum load to find if there are bottlenecks in the application.
    After all this explanation I would like to know if 25 threads for
    "background" and on-line processes is too low (as I'm afraid they are).The
    It all depends of the usage pattern. I'd say that for a production
    environment
    with any noticeable load, it's low.
    problem is we can't seem to increase the number of threads without being
    very careful with JDBC connection pools.Yes, you will have to increase size of the pools to match maximum
    number of ongoing transactions. Minimum would be a number of execution
    threads. Actual number should be determined either by load testing or
    by setting it to a guaranteed high level.
    Currently we have two connection pools. We do demarcate transactions inthe
    clients (servlets, batch processes) we have a "transacted" pool and a "non
    transacted" one.
    We are delegating persistence to the contanier (formally in our case weare
    using TopLink persistence and it uses in it's deployment descriptor both
    types of pools)
    Our configuration is as follows:
    Oracle pool NON Tx 60 connections
    Oracle pool Tx 30 connections
    initially we create 5 connections for each pool with an increment of 5 for
    each one too.
    From the tests I have made I have discovered that setting more threadsthan
    the minimum amount of pools yields to this exception:That's quite natural.
    weblogic.common.ResourceException: No available connections in pool
    myNonTxPool[eaten]
    the behaviour I would expect is that in case a thread needs a connectionand
    there isn't any one available the thread may be blocked and it wouldreceive
    That would lock exec threads very quickly. A connection pool is a vital
    resource that is to be available constantly. So weblogic uses fail-fast
    approach so that you can adjust setting to match highest load.
    the connecion once one is released, of course as I can see in the stackthe
    ConnectionPool.reserveNoWait() method is behaving just the other way.>
    The main problem with this is that as you can see we are "forced" to spend
    90 (60+30) connections to the DB (even we will never use more than 25
    (15+10) simultaneously just because we must assure that at least there is
    one "reserved" connection to each thread.That's right.
    Our DBA thinks that it can't be possible that we spend such number of
    connections that could be taken by another application(s) (as the DB is
    shared with other apps)I don't think it's a correct observation. Oracle can be configured to handle
    more connections. I saw weblogic pools configured to handle 200
    connections.
    Currently our DB system is not set as "multithreaded" so each connection
    created against the DB is a process on the system and of course they are a
    scarce resource.Application demand for resources should be satisfied.
    My question is. What would be a "fine" number of threads for anapplication
    like this that is mainly "background-batch processing" but assuringon-line
    users have their threads always available?It should be high enough to satisfy requirement to handle given number
    of concurrent requests processed on given hardware. Normally this
    is determined by load testing and gradual increase of this number
    to the point where you see that hardware (seen as CPU load)
    cannot handle it. Buy the way this point sometimes is unreachable
    as application becomes DB-bound, i.e. bottleneck is shifted to
    the database.
    I have just another doubt (maybe this is not the right thread to ask forit
    but...) how does the UserTransaction actually works? I mean, is the
    connection given to the thread (and thus extracted from pool) as soon asthe
    thread begin it's work? or is it given in the instant of "committing" tothe
    It's given when a connection, assuming it's obtained from TxDatasource,
    is requested.
    DB. I know maybe using TopLink changes default Weblogic CMP behavior but I
    would like to know what the "default" Weblogic behavior is; and, what
    happens when you don't start a transaction in the client and totalexecution
    time exceeds 30 seconds? I have seen a rollback due to "exceeding" those30
    seconds although I'm sure we do not open any transaction, what kind of
    "transaction" is that? Is just a way of Weblogic to assure a thread is notFor instance, stateful session beans are transactional.
    "locked" more than a certain period of time so the system never "stalls"?Basically, no, it's not. There is no way to "unlock" thread after certain
    period.
    So when a queue has finished processing, TX monitor checks the timeout,
    and if there is one, issues a corresponding rollback. So, it's possible
    for thread to run for 10 hours if the timeout is 30 seconds.
    Since 7.0 weblogic is capable of detecting such situations so that
    administrator can be informed about it and required actions can be
    taken [on application side].
    Hope this helps.
    Regards,
    Slava Imeshev

  • Basics of Thread Pool and MDB

    Hi,
    I am not able to connects the dots between Self-Tuning Thread Pool Threads ,number of MDB's and Open connection to Queue Manager (Listeners).
    Following is my setting
    1 Self-Tuning Thread Pool : Default i.e 5
    2) Initial Beans in Free Pool: 100
    3) Max Beans in Free Pool : 200
    What i see
    Pool Current Count :- 100 (this is as expected)
    On start up of server 105 MDB's are created (No problem with this ) (Have put static variable incrementing in constructor)
    When Messages are sent to MQ (50-100) the "Beans In Use Count" under Monitoring never shows more then 16
    and finally the "open MQ Count" on MQ Explorer is always 16.
    Questions.
    1) What do i need to change, for increasing the count of "Beans In Use Count" and "open MQ Count" on MQ Explorer to be more than 16?
    2)If the Self-Tuning thread pool is 5, how come 16 beans are executed at once? or its just that 16 are picked from pool and only 5 are executed at given time?
    NOTE:- I am using weblogic app server to connecto IBM MQ with JMS Module, so creating the customer WorkManager and attaching it to my listener (MDB) is not supported by weblogic, it says the mdb is not under webloic thread pool so this settingt will have no effect
    -thnaks

    Hi ,
    You have to create a custom work manager and then you have to associate this customer work manager to the dispatch policy of the MDB to increase the threads.
    Following links would surely help you as TomB has explained the same issue very well, do have a look at them.
    Re: WorkManager Max thread constraints not applied to MDB
    Also you can also go through this links which would help you get more information:
    Topic: Configuring Enterprise Beans in WebLogic Search for "To map an EJB to a workmanager"
    http://middlewaremagic.com/weblogic/?p=5665
    Topic: WebLogic WorkManager with EJB3 And MaxThread Constraint
    http://middlewaremagic.com/weblogic/?p=5507
    Regards,
    Ravish Mody
    http://middlewaremagic.com/weblogic/
    Come, Join Us and Experience The Magic…

  • Threads: Pooling and groups

    Hello there! I need to implement a solution that will use threads, I write down my problem, to be more precisely on the questions.
    The scenario:
    An extrator, reads from a flat file, and insert into a table.
    Another process runs threads to read this table, perform an ETL and then insert in antoher table. I'm considering that the file read process's time is <<< (much smaller) than the ETL, due the transformations involved.
    So my first solution was to use thread pooling (Im reading about, and already have some implementations), since I dont want to have more than a few threads running at same time (let's say 5-6).
    Ok my first Ideia was to do something like this:
    a main class that will run a thread (the text file extractor), this will be done from the pool of threads, so I have n-1 threads left.
    This thread would read the lines and at each 10k read, commit the result, and now its the tricky part, warn its parent process (main class) that it already processed 10k registers. The main class would know that and then start a new thread (the ETL thread, reading from 0-10k) now I have n-2 threads left. The process would go on, since the text thread is faster, It would continue warning the main class, that it had processed 10k registers and main class would continue dispatching new threads, untill it reaches a maximum number (controled by the pool). The pool would be responsible to create its own list of waiting threads to run.
    My main problem is to make sure that the text thread can warn the main thread. Can someone point me so directions to it? a tutorial, a hint, anything would help

    Thread.sleep()
    Thread.interrupt()
    Well, I'm sorry but I dont think ? I made my self
    clear. I need to know how to warn my parent thread not
    put the one I'm running in sleep or terminate it.Well. A call to interrupt() does not terminate another thread,
    rather, like the name indicates, it interrupts it, but only if
    the thread to be interrupted is blocking on a sleep(), join(), or wait() call or is blocking on interruptible I/O (java.nio.channels stuff).
    If the thread is not currently blocking, a flag is set.
    If there is no need for the parent to sleep() you can just call interrupted() to check the flag at regular intervals.

  • Browse and update database tables

    I'm looking for a tool that will let me connect to an Oracle database, select a table and some fields off the table and build a simple java class to navigate / update the data.
    Essentially, I'm looking for a tool that replicates the way Microsoft Access can build a form for navigation and update of a database table.
    However, I want to use java, not MS Access.
    Any ideas if such a tool is available ?
    Thanks

    http://squirrel-sql.sourceforge.net/

  • A good design for a single thread pool manager using java.util.concurrent

    Hi,
    I am developing a client side project which in distinct subparts will execute some tasks in parallel.
    So, just to be logorroic, something like that:
    program\
                \--flow A\
                           \task A1
                           \task A2
                \--flow B\
                            \task B1
                            \task B2
                            \...I would like both flow A and flow B (and all their launched sub tasks) to be executed by the same thread pool, because I want to set a fixed amount of threads that my program can globally run.
    My idea would be something like:
    public class ThreadPoolManager {
        private static ExecutorService executor;
        private static final Object classLock = ThreadPoolManager.class;
         * Returns the single instance of the ExecutorService by means of
         * lazy-initialization
         * @return the single instance of ThreadPoolManager
        public static ExecutorService getExecutorService() {
            synchronized (classLock) {
                if (executor != null) {
                    return executor;
                } else {
                    // TODO: put the dimension of the FixedThreadPool in a property
                    executor = Executors.newFixedThreadPool(50);
                return executor;
         * Private constructor: deny creating a new object
        private ThreadPoolManager() {
    }The tasks I have to execute will be of type Callable, since I expect some results, so you see an ExecutorService interface above.
    The flaws with this design is that I don't prevent the use (for example) of executor.shutdownNow(), which would cause problems.
    The alternative solution I have in mind would be something like having ThreadPoolManager to be a Singleton which implements ExecutorService, implementing all the methods with Delegation to an ExecutorService object created when the ThreadPoolManager object is instantiated for the first time and returned to client:
    public class ThreadPoolManager implements ExecutorService {
        private static ThreadPoolManager pool;
        private static final Object classLock = ThreadPoolManager.class;
        private ExecutorService executor;
         * Returns the single instance of the ThreadPoolManager by means of
         * lazy-initialization
         * @return the single instance of ThreadPoolManager
        public static ExecutorService getThreadPoolManager() {
            synchronized (classLock) {
                if (pool !=null) {
                    return pool;
                } else {
                    // create the real thread pool
                    // TODO: put the dimension of the FixedThreadPool in a property
                    // file
                    pool = new ThreadPoolManager();
                    pool.executor = Executors.newFixedThreadPool(50);
                    // executor = Executors.newCachedThreadPool();
                    return pool;
         * Private constructor: deny creating a new object
        private ThreadPoolManager() {
        /* ======================================== */
        /* implement ExecutorService interface methods via delegation to executor
         * (forbidden method calls, like shutdownNow() , will be "ignored")
          // .....I hope to have expressed all the things, and hope to receive an answer that clarifies my doubts or gives me an hint for an alternative solution or an already made solution.
    ciao
    Alessio

    Two things. Firstly, it's better to use     private static final Object classLock = new Object();because that saves you worrying about whether any other code synchronises on it. Secondly, if you do decide to go for the delegation route then java.lang.reflect.Proxy may be a good way forward.

  • Cold Fusion in a generic thread pool and enabling JAVA don't mix

    I've got Cold Fusion MX installed on a server running Sun One 6.1. I ran into a problem trying to enable JAVA (for servlet support) which I had previous disabled because I didn't use it.
    Well, when I went to enable JAVA on the server last week, the service wouldn't restart and the error logs gave me no indication of the problem.
    Through a tedious trial-and-error process I've found that having Cold Fusion running under a generic thread pool while trying to have JAVA (the j2ee plugin) running under Sun One simply doesn't work (for whatever reason).
    Once I killed the pool, everything runs fine.
    Does anyone happen to know why this is? I keep CFMX under its own thread pool because there are certain elements to CFMX that aren't wholly stable and can result in CFMX crashing. If it crashes, the process keeps accepting requests, but never processes them. I'd like to keep the native thread pool free to keep accepting non-CFMX requests even when CFMX crashes.
    Thus the separate thread pool for CFMX.
    But now I can't run CFMX in a separate thread pool with JAVA enabled.
    Anyone have any insights into why this is?
    Thanks

    Two things. Firstly, it's better to use     private static final Object classLock = new Object();because that saves you worrying about whether any other code synchronises on it. Secondly, if you do decide to go for the delegation route then java.lang.reflect.Proxy may be a good way forward.

  • Scheduled thread pools and blocking

    Hello,
    I am using a scheduled thread pool created in the following way:
    ScheduledExecutorService scheduler = Executors.newScheduledThreadPool();I want to schedule a task on the scheduler, but this task uses a MulticastSocket and can block on:
    byte[] b = new byte[BUFFER_LENGTH];
    DatagramPacket dgram = new DatagramPacket(b, b.length);
    socket.receive(dgram);Say I schedule this code to run at 500 ms. The first run blocks on the receive method. If the block lasts for more that 500ms, what happens when the scheduler allocates another thread at the next 500ms mark? Can I "lose" a thread from the pool permanently? Can I cause a backup of multiple threads blocking every time the scheduler runs the task?
    Thanks!
    -pm

    Well it used to be a plain old Runnable with the receive() inside the run() method, and the runnable was launched inside a Thread. However, I have an infrastructure that adds tasks to a ScheduledExecutorService so that I can run tasks that require a timing mechanism. I also have an ExecutorService for executing tasks at one time. I want to use these concurrency facilities to get this task to always run, not just once, and I thought scheduling would allow that. Would the ExecutorService's submit() method do that? Would it make more sense to have the run() method loop:
    run(){
    byte[] b = new byte[BUFFER_LENGTH];
    DatagramPacket dgram = new DatagramPacket(b, b.length);
    while(true){
    socket.receive(dgram);
    // do something ...
    }and then have ExecutorService simply run execute()?
    Thanks!

  • Define hashed table using database table

    Hi,
    I have a database table and would want to define a hashed table using this table structure, how would I do that?
    Thanks
    RT

    Hi Rob,
    The syntax is as follows,
    DATA ITAB TYPE HASHED TABLE OF SPFLI
                   WITH UNIQUE KEY CARRID CONNID.
    The table object ITAB has the type hashed table, a line type corresponding to the flat structure SPFLI from the ABAP Dictionary, and a unique key with the key fields CARRID and CONNID. The internal table ITAB can be regarded as an internal template for the database table SPFLI. It is therefore particularly suitable for working with data from this database table as long as you only access it using the key.

  • Deleting and updating database table

    hi all,
    i have to update the database table based on my internal table(both having same structure).
    my database has 2 records having a key field 1 and 2 respectively.(2 records)
    and my internal table has records with key fields 3, 4 and 5 respectively(3 records) .
    i want to delete all data from database table first..
    then i want to insert all the three records in the database table..
    finally i want my database to have 3 records with key fields 3, 4 and 5 respectively that are in the internal table
    what should be the correct way?

    Hi ,
    to delete all the records from dbtab
    DELETE dbtab.
    to update the database by using internal table
    -MODIFY dbtab       FROM TABLE itab.
    but as per my knowledge structures of internal table and database table should be same
    if the database table is a Ztable please change the structure of database table as you said
    Put fields 3,4and 5 as key fields
    Thanks & Regards,
    Sateesh.

Maybe you are looking for

  • Missing iviews for Personnel Cost Planning and Simulation

    Hi,  We are implementing "Personnel Cost Planning and Simulation" in R/3 version 5(mySAP ERP). At present we have the following Business packs in our Enterprise Portal Server. 60.1.5 and 60.1.1(mySAP ERP 2004). We uploaded both the BP's in our test e

  • How to remove a freeze frame in final cut pro x

    I've added a freeze frame using Add Freeze Frame, but I don't know how to remove it and go back to the normal timing.  I can remove it immediately with Undo, but I don't know how to do it later.  I've searched around and the only close answer is usin

  • Problems With CURSORS in PRO*C

    Hi all, I have a problem with cursors in proc 1. Can i declare a cursor and with in it another cursor in proc like EXEC SQL DECLARE emp_cursor CURSOR FOR SELECT ........; EXEC SQL OPEN emp_cursor; for(;;) EXEC SQL FETCH emp_cursor INTO :emp_structure

  • Deletion of BOM.

    Hi All, I have accidentally created a Bill of Material with wrong unit of measure for the header material, how can I get this one corrected ?? If I set the deletion flag the records will still remain there and I still cant create an alternate BOM wit

  • When I install Illustrator on a PC windows 7/ 64 bit, I get get the 18.0.0 version and not the newest version 18.1.1 that is the

    I have tried to upgrade from one of  the sites I was tolk to try  to install from. But but I'm not allowed to run the file - It doesn't help being admin Any idea Bet Regards Per