Thread reporting blocked in a semaphore

My problem: I want a thread to report itself blocked in a binary semaphore and I am using the following seemingly hokey way to do this:
if (thread.availablePermits() == 1){
     thread.acquire();
else {
     Print some kind of "Hey I am blocked" message
}Edited by: 832844 on Feb 15, 2011 12:45 PM
Edited by: 832844 on Feb 15, 2011 12:50 PM
Edited by: 832844 on Feb 15, 2011 12:50 PM

Ok, good to go. I was not aware tryAcquire returned boolean.
So then:
if (!(thread.tryAcquire())){
      print silly error message...}That about right?

Similar Messages

  • Testcase for error - "Unable to allocate thread control block"

    Hello,
    The down-below code throws the error message:
    db_stat: Unable to allocate thread control block
    BDB: 4.8, OS: Ubuntu 9.10
    Thanks
    #include <stdlib.h>
    #include <sys/ipc.h>
    #include <db.h>
    #define DIRECTORY "/tmp/db"
    int main()
    // open environment
    DB_ENV *handle;
    int status = db_env_create( &handle, 0 );
    status = handle->set_cachesize( handle, 0, 32*1024*1024, 0 );
    status = handle->set_thread_count( handle, 0x100 );
    key_t key = ftok( DIRECTORY, 'M' );
    handle->set_shm_key( handle, key );
    u_int32_t flags = DB_CREATE | DB_INIT_MPOOL | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_SYSTEM_MEM;
    status = handle->open( handle, DIRECTORY, flags, 0644 );
    if( status != 0 )
    exit( 1 );
    // raise error
    chdir( DIRECTORY );
    for( int i=0; i < 0x1000; ++i )
    system( "db_stat -e | grep process/thread | wc" );
    return 0;
    }

    Hello,
    I am still looking into this, but upon closer examination here is the situation, basically as reported.
    The test calls set_thread_count which sizes the memory. In __env_attach(), (dbenv->thr_max is used to size the region. So you are correct, the higher the value used in set_thread_count, the larger the size of the region will be. Eventually that memory will be depleted, and __env_alloc_size() returns ENOMEM, after multiple calls to system(db_stat). __env_alloc_free() is not called. This is the part I am still investigating.
    The test uses system to fork a separate processes for db_stat and the failing stack is:
    lt-db_stat: assert failure: ../dist/../env/env_failchk.c/426: "ret == 0"
    lt-db_stat: __os_stack+0x2b
    lt-db_stat: __os_abort+0x1d
    lt-db_stat: __db_assert+0x47
    lt-db_stat: __env_set_state+0x53c
    lt-db_stat: __env_attach_regions+0x38b
    lt-db_stat: __env_open+0x154
    lt-db_stat: __env_open_pp+0x334
    lt-db_stat: lt-db_stat
    So db_stat is opening an environment, attaching to its region, and then __env_set_state() calls __env_alloc(). It is __env_alloc() which fails with ENOMEM after some point when there is no more space to be allocated from the shared region. And I'm still looking into that space would be returned to the shared region.
    Thanks,
    Sandra

  • Db_checkpoint: Unable to allocate thread control block

    Hello,
    Every second day BDB 4.8 runs out of cache memory (size = 512MB).
    We have 10 static worker processes (no segfaults) and one
    db_checkpoint-process (checkpoints once a minute and exists).
    We use only DB_WRITE_NOSYNC
    After two days the db_checkpoint-process reports:
    db_checkpoint: Unable to allocate thread control block
    As soon as this error apears, I can neither checkpoint nor
    db_recover.
    Is there any chance (or a patch) to track down the memory leak?
    Thanks

    Hi Sandra,
    It happened again one hour ago. I had hardly problems with BDB 4.6
    Down below you will find a current "db_stat -e"
    We have 10 workers with persistent db-connection and once a minute
    a cronjob starts a checkpoint, then the cron-process exists.
    Every second day (40 to 48 hours) the checkpoint-process can't connect
    to the database and "db_checkpoint -1" says:
    db_checkpoint: Unable to allocate thread control block
    A normal "db_recover" would corrupt the database, I had to recover
    catastrophic.
    For sure the cache is not to small (512 MB, all database files: 1,3 GB)
    Thanks
    Markus
    Mon Nov 30 17:32:44 2009 Local time
    0x120897 Magic number
    0 Panic value
    4.8.24 Environment version
    9 Btree version
    9 Hash version
    1 Lock version
    15 Log version
    4 Queue version
    2 Sequence version
    1 Txn version
    Mon Nov 30 16:31:06 2009 Creation time
    0x9d316701 Environment ID
    2 Primary region allocation and reference count mutex [0/360 0% !Own]
    11 References
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Thread tracking information
    75 Thread blocks allocated
    4096 Thread allocation threshold
    521 Thread hash buckets
    Thread status blocks:
    process/thread 5055/3086948768: out
    process/thread 5686/3086850464: out
    [...snip...]
    process/thread 6056/3086653856: out
    process/thread 6087/3086649760: out
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    0x40988 Log magic number
    15 Log version number
    16MB Log record cache size
    0 Log file mode
    10Mb Current log file size
    370618 Records entered into the log
    370MB 354KB 853B Log bytes written
    4MB 466KB 1001B Log bytes written since last checkpoint
    17691 Total log file I/O writes
    0 Total log file I/O writes due to overflow
    198 Total log file flushes
    665 Total log file I/O reads
    1786 Current log file number
    8303086 Current log file offset
    1786 On-disk log file number
    3630597 On-disk log file offset
    1 Maximum commits in a log flush
    1 Minimum commits in a log flush
    17MB Log region size
    9 The number of region locks that required waiting (0%)
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    5387 Last allocated locker ID
    0x7fffffff Current maximum unused locker ID
    9 Number of lock modes
    131072 Maximum number of locks possible
    131072 Maximum number of lockers possible
    131072 Maximum number of lock objects possible
    30 Number of lock object partitions
    622 Number of current locks
    797 Maximum number of locks at any one time
    13 Maximum number of locks in any one bucket
    0 Maximum number of locks stolen by for an empty partition
    0 Maximum number of locks stolen for any one partition
    632 Number of current lockers
    708 Maximum number of lockers at any one time
    69 Number of current lock objects
    160 Maximum number of lock objects at any one time
    2 Maximum number of lock objects in any one bucket
    0 Maximum number of objects stolen by for an empty partition
    0 Maximum number of objects stolen for any one partition
    13M Total number of locks requested (13372706)
    13M Total number of locks released (13372083)
    0 Total number of locks upgraded
    5313 Total number of locks downgraded
    9 Lock requests not available due to conflicts, for which we waited
    1 Lock requests not available due to conflicts, for which we did not wait
    0 Number of deadlocks
    60M Lock timeout value (60000000)
    0 Number of locks that have timed out
    60M Transaction timeout value (60000000)
    0 Number of transactions that have timed out
    66MB 904KB The size of the lock region
    2141 The number of partition locks that required waiting (0%)
    465 The maximum number of times any partition lock was waited for (0%)
    0 The number of object queue operations that required waiting (0%)
    3 The number of locker allocations that required waiting (0%)
    0 The number of region locks that required waiting (0%)
    2 Maximum hash bucket length
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    320MB 1KB 604B Total cache size
    1 Number of caches
    1 Maximum number of caches
    320MB 8KB Pool individual cache size
    0 Maximum memory-mapped file size
    0 Maximum open file descriptors
    0 Maximum sequential buffer writes
    0 Sleep after writing maximum sequential buffers
    0 Requested pages mapped into the process' address space
    17M Requested pages found in the cache (99%)
    71264 Requested pages not found in the cache
    67 Pages created in the cache
    71264 Pages read into the cache
    17944 Pages written from the cache to the backing file
    0 Clean pages forced from the cache
    0 Dirty pages forced from the cache
    0 Dirty pages written by trickle-sync thread
    71298 Current total page count
    71014 Current clean page count
    284 Current dirty page count
    32771 Number of hash buckets used for page location
    4096 Assumed page size used
    16M Total number of times hash chains searched for a page (16751183)
    8 The longest hash chain searched for a page
    39M Total number of hash chain entries checked for page (39437498)
    0 The number of hash bucket locks that required waiting (0%)
    0 The maximum number of times any hash bucket lock was waited for (0%)
    7 The number of region locks that required waiting (0%)
    0 The number of buffers frozen
    0 The number of buffers thawed
    0 The number of frozen buffers freed
    71627 The number of page allocations
    0 The number of hash buckets examined during allocations
    0 The maximum number of hash buckets examined for an allocation
    0 The number of pages examined during allocations
    0 The max number of pages examined for an allocation
    0 Threads waited on page I/O
    0 The number of times a sync is interrupted
    Pool File: article.db
    4096 Page size
    0 Requested pages mapped into the process' address space
    1868517 Requested pages found in the cache (99%)
    13311 Requested pages not found in the cache
    0 Pages created in the cache
    13311 Pages read into the cache
    3428 Pages written from the cache to the backing file
    [...snip...]
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    1786/3630541 File/offset for last checkpoint LSN
    Mon Nov 30 17:32:01 2009 Checkpoint timestamp
    0x8000675a Last transaction ID allocated
    4096 Maximum number of active transactions configured
    0 Active transactions
    3 Maximum active transactions
    26458 Number of transactions begun
    0 Number of transactions aborted
    26458 Number of transactions committed
    0 Snapshot transactions
    0 Maximum snapshot transactions
    0 Number of transactions restored
    1MB 192KB Transaction region size
    0 The number of region locks that required waiting (0%)
    Active transactions:
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    31MB 32KB Mutex region size
    3 The number of region locks that required waiting (0%)
    4 Mutex alignment
    150 Mutex test-and-set spins
    254163 Mutex total count
    149165 Mutex free count
    104998 Mutex in-use count
    104998 Mutex maximum in-use count
    Mutex counts
    149165 Unallocated
    1 env region
    33 lock region
    797 logical lock
    1 log filename
    1 log flush
    1 log region
    74 mpoolfile handle
    71298 mpool buffer
    17 mpool file bucket
    32771 mpool hash bucket
    1 mpool region
    1 mutex region
    1 transaction checkpoint
    1 txn region

  • Mirrored RAID:  MediaKit reports block size error

    I am trying to create a 2nd set up backup drives for my photos.  I have two new iomega 2TB drives, which look essentially identical to drives I'm currently using as my primary backups as a mirrored RAID set.
    I can start the process with freshly erased and reformatted drives (with the default mac format, extended, journaled, unencrypted, not case-sensitive).  And after a minute or three, I see
    "MediaKit reports block size error, usually caused by not being a multiple of 512."
    The RAID options are Mirrored RAID, Mac extended journaled, and options settings are default.
    I see several series of posts with complaints about encrypting RAIDs and disk block sizes, but not unencrypted errors.   I actually started out trying to do this with the 2006 MBP running 10.6.8 and got a different error:  "POSIX reports:  the operation couldn't be completed. Operation not permitted."  I wasn't sure whether the 2TB RAID I already have was set up iwth the older or newer computer--it was definitely before I put Lion on this one--so I tried this one and now have a different error.
    Any idea what the problem might be? 

    Update:  I spent some time on the phone with an Apple support RAID expert, and couldn't figure out what the error was; we couldn't bypass it by playing with partitions on the drives, or any of another couple of manuevers that I've already forgotten.  He noted that his own searches were showing a lot of mentions of similar problems but only with Iomega drives, and he was finding the same links I found earlier about problems creating encrypted drives.  Now trying to decide if it's worth throwing more good money after bad for a call with Iomega support, and waiting to see if the iomega forum is at all helpful.

  • How to properly create a non-repeat report block?

    Hi everyone,
    I am trying to create a front page for my report. In the report data mode I have a query only return one record, so why that query in the data model showed as a group? <It has the query name - Q_1 on the top, and a group box at the bottom named G_xxxx.>
    Second question is why i use the report block wizard to create the frontpage, the wizard forced me to select a group, otherwise it give warning/error message. I only want to select the client name and his address and no need to repeat <so the frame should use the non-repeatable frame right?>.
    At the moment, I have two queries in the data model, first one is the "select" query which will only return one record for the report's front page, second query is a matrix (cross product) query for the main contents of my report. Both query has no link.
    This is my first Oracle report so any suggestions are the most welcoming.
    Thank you
    Bryan
    Edited by: Bryanevil on Apr 8, 2009 8:19 AM
    Edited by: Bryanevil on Apr 8, 2009 8:26 AM

    Thanks DC
    Thats what I was thinking too. Is this the only way to create a non-repeatable frame; no wizard can be use for create non-repeatable report block? Why I am asking this is because I am lazy, dont want to add all the fields and labels one by one to the frame.
    Secondly, in the data model, is there any way to create a query which the data model will not recognise it as a group query but a single record query?
    Regards
    Bryan

  • Prompts for different report blocks

    Hello All,
    I have a report which has two sections on the Summary Report.both report sections are filteres on prompts input by user
    Top Section =   based on the 'date' from the user response
    Bottom Section = based on 2 prompts  'date' plus the 'RSO' from the user respond
    Right now I have  Date and RSo in my query filter as prompt. But  RSO prompt should not apply to second block of report.How can I achieve this?
    Thanks in advance.

    Thanks Yuvraj,
    But I have to display the both report blocks in single report which i am doing in webi the report was input both prompts but one prompt had to effect on one block and another block has data based on both prompts.This is my req...Can I creating 2 separate queries and display in the report output in the below fashion as 2 report block in single report ?
    query 1
    prompt RSo and Date
    Query
    only Date

  • "MediaKit reports block size error" when formatting drive

    I got a new 2TB hard drive, and I'm trying to format it as HFS+ journaled case sensitive encrypted, each time I try I get the following error:
    "MediaKit reports block size error, usually caused by not being a multiple of 512."
    This is a brand new drive, it has a GUID partition map with one partition, that was created by Disk Utility, and the disk passed a full hardware scan from Drive Genius.
    Normally when I get an error I can google it, but this particular error only gives me links to RAID problems, and I'm not doing anything with RAID.
    What determines the block size? I did not get an option to set it anywhere that I could see.
    How do I fix this error and get my drive encrypted?

    This does indeed seem to be the problem.
    Before you replied I RMAed the Seagate disk assuming it to be faulty, because, well, 4k is a multiple of 512b and all. Today, my new WesternDigital disk arrived - it gives the IDENTICAL error. The changes of two disks from two vendors both being faulty seem low, so I think we can safely say OS X has a nasty security bug that has been languishing for some time.
    It seems the only way I can protect my backups is to use 3rd party softeware, or to find an old 2TB disk somewhere that still has 512b blocks rather than 4k blocks.
    Hopefully Apple get this bug fixed soon, and hopefully others will find this post when they google the error message and at least understand that their disk is probably fine.

  • Question About Java Threads and Blocking

    I'm helping someone rehost a tool from the PC to the Sun. We're using the Netbeans IDE and the Java programming language. I took a Java course several years ago, but need some help with something now. We're developing a front-end GUI using Swing to allow users to select different options to perform their tasks. I have a general question that will apply to all cases where we run an external process from the GUI. We have a "CommandProcessor" class that will call an external process using the "ProcessBuilder" class. I'm including the snippet of code below where this happens. We pass in a string which is the command we want to run. We also instantiate a class called "StreamGobbler" my coworker got off the Internet for redirecting I/O to a message window. I'm also including the "StreamGobbler" class below for reference. Here's the "CommandProcessor" class:
    // Test ProcessBuilder
    public class CommandProcessor {
    public static void Run(String[] cmd) throws Exception {
    System.out.println("inside CommandProcessor.Run function...");
    Process p = new ProcessBuilder(cmd).start();
    StreamGobbler s1 = new StreamGobbler("stdin", p.getInputStream());
    StreamGobbler s2 = new StreamGobbler("stderr", p.getErrorStream());
    s1.start();
    s2.start();
    //p.waitFor();
    System.out.println("Process Returned");
    Here's the "StreamGobbler" class:
    import java.lang.*;
    import java.io.*;
    // Attempt to make the output of the process go to the message window
    // as it is produced rather that waiting for the process to finish
    public class StreamGobbler implements Runnable {
    String name;
    InputStream is;
    Thread thread;
    public StreamGobbler (String name, InputStream is){
    this.name = name;
    this.is = is;
    public void start(){
    thread = new Thread (this);
    thread.start();
    public void run(){
    try{
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    while (true){
    String s = br.readLine();
    if (s == null) break;
    System.out.println(s);
    //messageWindow.writeToMessageArea("[" + name + "]" + s);
    is.close();
    catch(Exception ex){
    System.out.println("Problem reading stream" + name + "...:" + ex);
    ex.printStackTrace();
    The "CommandProcessor" class calls two (2) instances of the "StreamGobbler" class, one for "stdin" and one for "stderr". My coworker discovered these are the 2 I/O descriptors that are needed for the external command we're running in this case. We're actually called the Concurrent Versions System (cvs) command from the GUI. Here's what we need it to do:
    We want to display the output real-time as the external process is executing, but we want to block any actions being performed on the GUI itself until the process finishes. In other words, we want to show the user any generated output from the process, but don't want to alllow them to perform any other actions on the GUI until this process has finished. If we use the "waitFor()" function associated with a process, it blocks all external process output until the process has completed and then spews all the output to the screen all at once. That's NOT what we want. Also, if we don't use the "waitFor()" function, the code just continues on as it should, but we don't know how to block any actions on the GUI until this process has finished. My coworker tried the following code, but it also blocked any output until the process had finished:
    while (s1.thread.isAlive() || s2.thread.isAlive())
    // We really don't do anything here
    I'm pretty sure we have to use threads for the output, but how do we instantly show all output and block any GUI actions?
    Thank you in advance for your help!

    You're talking about a GUI, but there's nothing in that code which is putting events into the GUI update thread. You also say that nothing happens to the GUI until the CommandProcessor.Run() method returns if you wait for the process.
    This implies that you're calling CommandProcessor.Run() in an ActionListener. This will block the GUI thread until it completes.
    I was going to explain what to do, but a quick Google informed me that there's a new class which is designed to help in these situations SwingWorker (or as a [separate library|https://swingworker.dev.java.net/] if you're not up-to-date yet).

  • Threads and blocking i/o

    background i am building a multi-cliented server based on the model of one thread per client. client threads wait on a BufferedReader in the run() method for data over the network and take the appropriate action based on the input.
    problem a client thread needs in certains circumstances to kill the thread of another client. since the run() method loops on the blocking input of BufferedReader, any flag or call to interrupt() will not be evaluated until the BufferedReader unblocks. this is bad since it means that the client who is to be killed will not return from run() until the client app talking to the thread sends some data to unblock BufferedReader. the result is a potential dos attack against this server. bad stuff.
    example the current situation: client app one connects to the server spawning Thread-1. client app two connects to the server spawning Thread-2. app two triggers killSomeClient() on Thread-1. Thread-1 continues to linger until client app 1 transmits data to the server, whereupon Thread-1 dies.
    example the required functionality: app one connects to Thread-1. app two connects to Thread-2. app two triggers killSomeClient() on Thread-1. Thread-1 returns from the run() loop and the thread dies immediately.
    what i've tried well, obviously, stop() and destroy() are what i really want... but that's not an option. have tried setting a flag in the while loop to be set by killSomeClient() (ie while(keepRunning && (inputFromClient = in.readLine()) != null) ). have tried interrupt() in the same manner.
    potential solutions i can think of a replacement for stop() or some effective non-blocking read allowing me to loop around the reader, grabbing one char at a time and continuing the loop even if the queue is empty.
    the code example this is a very pared-down version of the code showing only the material necessary for this example (better for readability!). aside from this issue, the application runs.
    someClient
    public class someClient{
        private Socket socket;
        private BufferedReader in;
        private String inputFromClient;
        someClient(Socket socket){
            this.socket = socket;
            this.in = new BufferedReader(new InputStreamReader(theSocket.getInputStream()));
        public void run(){
            try{
                // waits on blocking input
                while((inputFromClient = in.readLine()) != null){
                    System.out.println(inputFromClient);
            }catch(Exception e){}
        public void killSomeClient(someClient killme){
            // help!!
    someServer
    public class someServer{
        private ServerSocket ss;
        public someServer(){
            ss = new ServerSocket(9999);
        public startServer{
            Socket socket = ss.accept();
            someClient client = new someClient(socket);
            client.start();
    }

    problem a client thread needs in certains
    circumstances to kill the thread of another client.
    since the run() method loops on the blocking input of
    BufferedReader, any flag or call to interrupt() will
    not be evaluated until the BufferedReader unblocks.In general, the best approach to terminating a blocking operation is to invalidate the object on which that operation depends. In your case, closing the socket will terminate the read().
    The following is a rather lengthy piece of code that's actually been tested :-)
    import java.io.*;
    import java.net.*;
    public class SocketStopper
        private final static int  PORTNUM = 10000;
        public static void main( String argv[] )
        throws Exception
            System.err.println("Starting server");
            Server server = new Server();
            (new Thread(server)).start();
            Thread.sleep(2000);
            System.err.println("Starting client");
            Client client = new Client();
            (new Thread(client)).start();
            Thread.sleep(2000);
            System.err.println("About to close server socket");
            server.closeSocket();
            Thread.sleep(2000);
            System.err.println("About to exit");
            System.exit(0);
        /** This object establishes a connection to the server port and then
         *  sleeps for 10 minutes without writing anything. This should cause
         *  the reader to block for input.
        public static class Client
        implements Runnable
            public void run()
                try
                    Socket sock = new Socket(InetAddress.getLocalHost(), PORTNUM);
                    System.err.println("Client established connection");
                catch (Exception e)
                    System.err.println("Client unable to establish connection: " + e);
                    return;
                try
                    Thread.sleep(10 * 60000L);
                catch (InterruptedException ignored)
        /** This object sets up a server socket. It accepts the first connection
         *  from that socket and attempts to read from it, which should block.
        public static class Server
        implements Runnable
            private Socket _sock;
            public void run()
                try
                    ServerSocket srv = new ServerSocket(PORTNUM);
                    _sock = srv.accept();
                    System.err.println("Server accepted connection");
                catch (Exception e)
                    System.err.println("Server unable to receive connection: " + e);
                    return;
                try
                    _sock.getInputStream().read();
                    System.err.println("read() completed normally");
                catch (IOException e)
                    System.err.println("read() terminated with exception: " + e);
            public void closeSocket()
                try
                    _sock.close();
                catch (IOException ignored)
    }

  • How to display the alv report blocks wise with out using the blocked alv

    Hi
    How to display the alv report with out using the blocked alv function module.
    Thanks
    Chinnu

    see this Standard Program
    RPR_ABAP_SOURCE_SCAN

  • Oracle Reports blocks WLS 10.3.5.0 + Windows 2008 R2

    Hello,
    I am having a problem with Reports Server which blocks when OS RAM consumptions reaches a value of 10GB.
    (It seems to me that Forms are workling without any problem)
    To get better overview I will give you some more details.
    1. WLS 10.3.5.0 is installed on Windows Server 2008 R2 Standard SP1
    2. Managed servers installed Forms and Reports (11.1.2)
    3. Processor - Intel(R) Xeon(R) CPU X5550 @ 2,67GHZ 2,67GHZ (4 processors) 64 bit
    4. JDK type - SUN, JDK version - jdk1.6.0_30
    5. RAM 18 GB (first there was 10GB, then it was upgraded to 18GB)
    6. heap size is default (Admin server -Xms 256 -Xmx 512, Forms server -Xms 256 -Xmx 512, Reports server -Xms 256 -Xmx 512)
    So, I will get back to a problem. I am running application in production environment. When I start WLS with Forms and Reports
    servers, RAM consumption on OS level is cca. 4,5 GB. When 40 users are connected to application, memory consumption on
    OS level is cca. 6GB. When memory consumption reaches the value of 10 GB Reports Server is not executing jobs any more (even
    though there are 8GB of RAM available). To be more precise number of current jobs and execution time of each job is increasing and
    job never finishes. I will also mention that all engines are trying to process job requests until all engines are used.
    I would be thankful for any kind of information, tips or help.
    Thank you.
    Best regards,
    adi_071

    Hello,
    I am having a problem with Reports Server which blocks when OS RAM consumptions reaches a value of 10GB.
    (It seems to me that Forms are workling without any problem)
    To get better overview I will give you some more details.
    1. WLS 10.3.5.0 is installed on Windows Server 2008 R2 Standard SP1
    2. Managed servers installed Forms and Reports (11.1.2)
    3. Processor - Intel(R) Xeon(R) CPU X5550 @ 2,67GHZ 2,67GHZ (4 processors) 64 bit
    4. JDK type - SUN, JDK version - jdk1.6.0_30
    5. RAM 18 GB (first there was 10GB, then it was upgraded to 18GB)
    6. heap size is default (Admin server -Xms 256 -Xmx 512, Forms server -Xms 256 -Xmx 512, Reports server -Xms 256 -Xmx 512)
    So, I will get back to a problem. I am running application in production environment. When I start WLS with Forms and Reports
    servers, RAM consumption on OS level is cca. 4,5 GB. When 40 users are connected to application, memory consumption on
    OS level is cca. 6GB. When memory consumption reaches the value of 10 GB Reports Server is not executing jobs any more (even
    though there are 8GB of RAM available). To be more precise number of current jobs and execution time of each job is increasing and
    job never finishes. I will also mention that all engines are trying to process job requests until all engines are used.
    I would be thankful for any kind of information, tips or help.
    Thank you.
    Best regards,
    adi_071

  • Getting web report blocked by popup blockers

    I have some of my reports deployed over web.
    They being called from forms using web.document_show
    I open them in the separate window (_blank). Some of my users complain that they can't see the report and there is a message on the browswer (blocked pop up window).
    What can I do to correct this? If I display the reports in the same window then when the user use browser's back button, it brings them to log in window and not back to the form that called report. Please help

    You have to configure or maybe even disable the popup blocker on the PC where these problems occur.
    You can also try to Shift-Click or Ctrl-Click on the link. Popup blockers usually recognize this to allow a popup.

  • Interrupting a Thread thats blocking for I/O

    OK, here is the problem. I need to interrrupt a thread that is blocking on I/O. The run method of my thread looks something like this...
    run(){
    while(connected){
    try{
    recieved = in.readLine();
    // do something with recieved data
    } catch(InterruptedIOException e){
    // do something
    } catch(SocketException e){
    // do something else
    } catch(IOException e){
    // do some more of something else
    I also have a fuction like this...
    private void stop(){
    connected = false;
    myThread.interrupt();
    None of this appears to be working. The interrup method runs but no exceptions are thrown. I need to be able to tell the thread to stop blocking for I/O an stop running. Is there some other way, or am I on the right track and its just coded wrong? Any help would be great.

    There are 2 reasons for your code to mallfunction:
    1. You should catch an InterruptedException first (this is thrown at Thread.interrupt()), not InterruptedIOException (which comes from the Socket).
    2. For ensuring your thread.stop, you have messed up 2 different techniques:
    Setting the connected = false in your stop method could make you jump out your whole while loop, so you will never reach you code in the catch blocks.
    You also call myThread.interrupt() so if you stop() method occurs in the middle of processing, you will end-up in you catch(InterruptedException) block.
    So there are 2 distinct reactions that may occur at your stop(), depending on them moment when it is called, which doesn't look so good.
    Depending on how you want your code to behave (to end-up in the catch block or after the whole while loop) use just one of the instructions in your stop() method. It is recomended that you keep 'connected = false', but then you have to watch out the blocking IORead :(

  • Java thread synchronized block

    i am still a noob comes to thread and synchronized.
    i heard people said that i shouldn't synchronized on "mySet" because "mySet" is getting modified in the synchronized block.
    is this true?
    or should i use a different object to synchronized the block. what's the advantage or disadvantage to use a different object to synchronized the block.
    thanks
    public class Test {
      final Set mySet = new HashSet(); 
      final Map myMap = new HashMap();
      public void add(Object o) {
        synchronize(mySet) {
          mySet.add(o);
          myMap.add(o);
      public void clear(){
        synchronize(mySet) {
          mySet.clear();
          myMap.clear();
    }

    yaliu07 wrote:
    i am still a noob comes to thread and synchronized.
    i heard people said that i shouldn't synchronized on "mySet" because "mySet" is getting modified in the synchronized block.
    is this true? No, that's not a reason not to sync on that object. In fact, in some cases it's a reason why you should sync on that object.
    Most of the time it doesn't matter which object you sync on, as long as all the relevant blocks are synced on the same object. There are a couple of considerations to keep in mind though that might affect the choice of object.
    In some cases, you want to sync on an object that's not exposed to the outside world, for instance a private Object member variable that exists only to be a lock. The reason for this is that if you sync on something that's exposed to the outside (such as "this", which is what gets synced on when you declare a non-static method as synchronized), then other code might also sync on that object, causing deadlock or thread starvation.
    In other cases, you DO want to expose the object, so that you can use it to ensure that other code and your synced code only enter the critical sections one thread at a time. For instance, in Collections.synchronizedXxx() methods, the return object's methods are all synced on "this", and any code that iterates over that collection must also sync on that object, so that the iteration code and the collection object's own code don't step on each other's toes.
    Much of the time, however, the choice of an object to sync on is just one that's convenient and logical for the humans writing and reading the code.

  • Alv reports:blocked list diplay

    can u brief about blocked list daisplay
    thanks and regards
    murali krishna

    hi,
    *& Report  ZLAXMI_ALVEXER3                                             *
    REPORT  ZLAXMI_ALVEXER3   MESSAGE-ID ZZ                      .
    *& TABLES DECLARATION                                                  *
    TABLES: MARA, MAKT, MARC.
    *& TYPE POOLS DECLARATION                                              *
    TYPE-POOLS: SLIS.
                          DATA DECLARATIONS                             *
    DATA: V_FLAG TYPE C.                        "Flag to display the header
    DATA: V_REPID TYPE SY-REPID.
    *& INTERNAL TABLE DECLARATION                                          *
    DATA: BEGIN OF I_MARA OCCURS 0,
           MATNR LIKE MARA-MATNR,
           MTART LIKE MARA-MTART,
           MATKL LIKE MARA-MATKL,
           MEINS LIKE MARA-MEINS,
           NTGEW LIKE MARA-NTGEW,
          END OF I_MARA.
    DATA: BEGIN OF I_MAKT OCCURS 0,
           MATNR LIKE MAKT-MATNR,
           SPRAS LIKE MAKT-SPRAS,
           MAKTX LIKE MAKT-MAKTX,
           MAKTG LIKE MAKT-MAKTG,
         END OF I_MAKT.
    DATA: BEGIN OF I_MARC OCCURS 0,
            MATNR LIKE MARC-MATNR,
            WERKS LIKE MARC-WERKS,
            LADGR LIKE MARC-LADGR,
            MTVFP LIKE MARC-MTVFP,
            DISPR LIKE MARC-DISPR,
            DISMM LIKE MARC-DISMM,
            DISPO LIKE MARC-DISPO,
          END OF I_MARC.
    *- Fieldcatalog
    DATA: IT_FIELDCAT  TYPE SLIS_T_FIELDCAT_ALV.
    *- For Events
    DATA:IT_EVENTS1 TYPE SLIS_T_EVENT,
         IT_EVENTS2 TYPE SLIS_T_EVENT.
    *- Fieldcatalog, Layout and Events
    DATA:X_FIELDCAT  TYPE SLIS_FIELDCAT_ALV,
         X_LAYOUT    TYPE SLIS_LAYOUT_ALV,
         X_EVENTS    TYPE SLIS_ALV_EVENT.
          Selection screen Declaration
    *--BLOCK1
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR,
                    S_MTART FOR MARA-MTART.
    SELECTION-SCREEN END OF BLOCK B1.
    AT SELECTION-SCREEN                                                 *
    *- Validations
    AT SELECTION-SCREEN.
      PERFORM VALIDATE_SCREEN.
                  START OF SELECTION                                    *
    START-OF-SELECTION.
    *- To get data from mara
      PERFORM GET_DATA.
    *to get data from makt
      PERFORM GET_DATA_MAKT.
    *to get data from marc
      PERFORM GET_DATA_MARC.
    *fieldcatalog
    PERFORM FORM_FIELDCATALOG.
                  END OF SELECTION                                    *
    END-OF-SELECTION.
    PERFORM DISPLAY_REPORT.
    *&      Form  GET_DAta
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA .
    *to get data from mara table.
      SELECT MATNR
             MTART
             MATKL
             MEINS
             NTGEW FROM MARA
             INTO TABLE I_MARA
             WHERE MATNR IN S_MATNR
             AND MTART IN S_MTART.
      IF SY-SUBRC = 0.
        SORT I_MARA BY MATNR.
      ENDIF.
    ENDFORM.                    " GET_DAta
    *&      Form  get_data_makt
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA_MAKT .
      SELECT MATNR
             SPRAS
             MAKTX
             MAKTG FROM MAKT
             INTO TABLE I_MAKT
             FOR ALL ENTRIES IN I_MARA
             WHERE
             MATNR = I_MARA-MATNR.
      IF SY-SUBRC = 0.
        SORT I_MAKT BY MATNR SPRAS.
      ENDIF.
    ENDFORM.                    " get_data_makt
    *&      Form  get_data_marc
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA_MARC .
      SELECT MATNR
             WERKS
             LADGR
             MTVFP
             DISPR
             DISMM
             DISPO FROM MARC
             INTO TABLE I_MARC
             FOR ALL ENTRIES IN I_MARA
             WHERE MATNR = I_MARA-MATNR.
      IF SY-SUBRC = 0.
        SORT I_MARC BY MATNR WERKS.
      ENDIF.
    ENDFORM.                    " get_data_marc
    *&      Form  form_fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    FORM FORM_FIELDCATALOG .
      DATA:L_POS TYPE I VALUE 1.
      CLEAR: L_POS.
      L_POS = L_POS + 1.
      X_FIELDCAT-SELTEXT_M = 'MATERIAL NO'.
      X_FIELDCAT-FIELDNAME = 'MATNR'.
      X_FIELDCAT-TABNAME = 'I_MARA'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '15'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SELTEXT_M = 'MATERIAL TYPE'.
      X_FIELDCAT-FIELDNAME = 'MTART'.
      X_FIELDCAT-TABNAME = 'I_MARA'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '5'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SELTEXT_M = 'MATERIAL GRP'.
      X_FIELDCAT-FIELDNAME = 'MATKL'.
      X_FIELDCAT-TABNAME = 'I_MARA'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '9'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SELTEXT_M = 'UOM'.
      X_FIELDCAT-FIELDNAME = 'MEINS'.
      X_FIELDCAT-TABNAME = 'I_MARA'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '3'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SELTEXT_M = 'NET WEIGHT'.
      X_FIELDCAT-FIELDNAME = 'NTGEW'.
      X_FIELDCAT-TABNAME = 'I_MARA'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '13'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      L_POS = L_POS + 1.
      X_LAYOUT-ZEBRA         = 'X'.
      REFRESH:IT_EVENTS1,IT_EVENTS2.
      CLEAR:X_EVENTS,IT_EVENTS1,IT_EVENTS2.
    ENDFORM.                    " form_fieldcatalog
    *&      Form  DISPLAY_REPORT
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_REPORT .
      V_REPID = SY-REPID.
    Set Default GUI status
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          I_CALLBACK_PROGRAM = V_REPID.
    *- To display quantity not in SAP
      IF NOT I_MARA[] IS INITIAL.
        CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
          EXPORTING
            IS_LAYOUT                  = X_LAYOUT
            IT_FIELDCAT                = IT_FIELDCAT
            I_TABNAME                  = 'I_MARA'
            IT_EVENTS                  = IT_EVENTS2
          TABLES
            T_OUTTAB                   = I_MARA
          EXCEPTIONS
            PROGRAM_ERROR              = 1
            MAXIMUM_OF_APPENDS_REACHED = 2
            OTHERS                     = 3.
        IF SY-SUBRC <> 0.
          MESSAGE I002 WITH 'Error in REUSE_ALV_BLOCK_LIST_APPEND'(002).
        ENDIF.
      ENDIF.
      IF NOT I_MAKT[] IS INITIAL.
        CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
          EXPORTING
            IS_LAYOUT                  = X_LAYOUT
            IT_FIELDCAT                = IT_FIELDCAT
            I_TABNAME                  = 'I_MAKT'
            IT_EVENTS                  = IT_EVENTS1
          TABLES
            T_OUTTAB                   = I_MAKT
          EXCEPTIONS
            PROGRAM_ERROR              = 1
            MAXIMUM_OF_APPENDS_REACHED = 2
            OTHERS                     = 3.
        IF SY-SUBRC <> 0.
          MESSAGE I002 WITH 'Error in REUSE_ALV_BLOCK_LIST_APPEND'(002).
        ENDIF.
    ENDIF.
      IF NOT I_MARC[] IS INITIAL.
        CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
          EXPORTING
            IS_LAYOUT                  = X_LAYOUT
            IT_FIELDCAT                = IT_FIELDCAT
            I_TABNAME                  = 'I_MARC'
            IT_EVENTS                  = IT_EVENTS1
          TABLES
            T_OUTTAB                   = I_MARC
          EXCEPTIONS
            PROGRAM_ERROR              = 1
            MAXIMUM_OF_APPENDS_REACHED = 2
            OTHERS                     = 3.
        IF SY-SUBRC <> 0.
          MESSAGE I002 WITH 'Error in REUSE_ALV_BLOCK_LIST_APPEND'(002).
        ENDIF.
    ENDIF.
    IF NOT I_MARA[] IS INITIAL OR NOT I_MAKT[] IS INITIAL
           OR I_MARC IS INITIAL.
        CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
          EXCEPTIONS
            PROGRAM_ERROR = 1
            OTHERS        = 2.
        IF SY-SUBRC <> 0.
          MESSAGE I002 WITH 'Error in REUSE_ALV_BLOCK_LIST_DISPLAY'(003).
        ENDIF.
      ENDIF.
    ENDFORM.                    " DISPLAY_REPORT
    *&      Form  VALIDATE_SCREEN
          text
    -->  p1        text
    <--  p2        text
    FORM VALIDATE_SCREEN .
    DATA: LV_MATNR LIKE MARA-MATNR,
          LV_MTART LIKE MARA-MTART.
    *MATERIAL VALIDATION.
      IF NOT S_MATNR IS INITIAL.
        SELECT MATNR
        INTO LV_MATNR
        UP TO 1 ROWS
        FROM MARA
        WHERE MATNR IN S_MATNR.
        ENDSELECT.
        IF SY-SUBRC <> 0.
          MESSAGE E000 WITH 'INVALID MATERIAL'(004).
        ENDIF.
      ENDIF.
    *MATERIAL TYPE VALIDATION
       IF NOT S_MTART IS INITIAL.
        SELECT MTART
        INTO LV_MTART
        UP TO 1 ROWS
        FROM MARA
        WHERE MTART IN S_MTART.
        ENDSELECT.
        IF SY-SUBRC <> 0.
          MESSAGE E000 WITH 'INVALID MATERIAL TYPE'(005).
        ENDIF.
      ENDIF.
    ENDFORM.                    " VALIDATE_SCREEN
    block alv
    when two or more DIFFERENT internal tables,
    of different fields and size,
    whose data may not at all be related to each other,
    -- then block alv is used
    Regards,
    Laxmi.

Maybe you are looking for

  • Hooking Macbook up to 40 ' Samsung LCD

    I just bought a mini display port adapter to hook my macbook to my LCD via HDMI. When I plug it in all that comes up on the LCD is my desktop wallpaper. How do I set it up so I can watch movies etc.. from my macbook through the TV?

  • Acrobat crashes when deleting "reply"

    Each time I reply to a comment and then "delete" the reply, Acrobat quits out of the document. Has anyone else had this problem?

  • HOW CAN I FORMAT MY NOKIA -73

    MY NOKIA-73 IS PROCESSING VERY SLOW. DUE TO THIS I WANT TO FORMAT IT. HOW CAN I FORMAT THE SYSTEM

  • Adding video to site?

    Hi, Thanks for any suggestions. I need to add a video to a site, I am still using dreamweaver MX and wanted to ask which program or extension might be the best way of doing this? Thanks again, Jill

  • Updating my digital clock

    I have written this programto display a digital clock yet i am having trouble updating it and displaying the results within the window. Can some Help me please! import java.io.*; import java.awt.*; import java.awt.event.*; import java.util.*; import