Java program with return value, what is the best way?

I was thinking something like this:
public class A {
public static int intMain(String... argv) {
///real program here
public static void main(String... argv) {
System.exit(intMain(argv));
But System.exit does not await user threads and I use a library which creates threads where I do not have control.
Is there a way to await every user thread without explicitly knowing them?

I just want to return a value to the OS... zero in case of normal quit, non-zero in case of abnormal termination. I do not see anything complex in that. Actually it I think is crazy that Java mains are only void.
About threads I use rabbitmq and it uses threads for its messaging. I noticed the problem because if I forget to correctly close rabbitmq objects the ``void main'' does not terminate while the ``int main'' does since system.exit does not wait.
At the moment the question is more about curiosity, really there is no simple way to say ``await all users threads''?

Similar Messages

  • HT5922 I have some devices that i no longer use with AirPlay. What's the best way to remove those devices from the AirPlay List?

    Bonjour,
    I have some devices that i no longer use with AirPlay. What's the best way to remove those devices from the AirPlay List?

    In article <e35sc3$ru1$[email protected]>,
    "-->dan mode" <[email protected]> wrote:
    > > All
    > > I have a website I would like to remove from the
    internet, However I am
    > > planning on keeping the IP for a development
    location and would like to
    > > put
    > > a page up that says this site is no longer
    available. Is this how you do
    > > it
    > > or are there other pages to display when a site is
    removed.
    > > Thanks
    > > Dave
    Depending on how long the site has been active, it may be
    already
    spidered by search engines and cached. However, for the most
    part, I
    usually use my FTP program OR even Dreamweaver itself (now
    that I can)
    to delete files on the server just as I do locally. Hit the
    delete and
    confirm

  • I bought CS6 extended yesterday (yes i did). I have CS4 and lots of photo's in bridge (tagged with keywords). What is the best way to get my photos from bridge cs4 to cs6? Is there a guideline how to go about so I don't loose any of my photos/keywords? Wh

    I bought CS6 extended yesterday (yes i did). I have CS4 and lots of photo's in bridge (tagged with keywords). What is the best way to get my photos from bridge cs4 to cs6? Is there a guideline how to go about: so I don't loose any of my photos/keywords? Who can help?

    The Bridge General Discussion can give you the specifics of transferring your information over to Bridge CS6.

  • With supervised ipads, what is the best way to transfer photos and videos from the ipad to the PC? Wireless transfer is not an option in our circumstances

    With supervised ipads, what is the best way to transfer photos and videos to the PC? Wireless transfer is not an option in our circumstances.

    There are only two ways of transfering things on the iPad.
      - via WiFi
      - via usb cable
    From what I have read, you need to connect to iTunes on the supervising PC.
    Robert

  • What data does SNMP return and what is the best way to explore it?

    Hi All
    I have some queries about using SNMP on Cisco devices.
    1. What is the best way to get an idea of what data MIBs can return?
    I have entered the commmand "show snmp mib". However, the number of MIBs generated is huge!
    2. Can you enter a command on the Cisco device itself that returns snmp data?
    e.g. if I want to see what data a MIB entry returns, can I interrogate it on the Cisco device itself rather than having to rely on network management software?
    The reason I ask is that we are currently looking for Network Management Software. However, I have no idea what data SNMP can return, therefore don't know if what the Management Software offers is comprehensive or not.
    Any suggestions on how best to get an idea the data SNMP can generate plus any other suggestions are very welcome!
    Thanks
    John

    Generally speaking, snmp can query about any parameter of the system. An enterprise class device has almost all conceivable parameters instrumented thus. A device's inventory (chassis, cards, ports, power supplies, software image, etc.) and the state of its interfaces and traffic they are carrying are among the primary ones.
    You can query a device's snmp variables remotely "by hand" using an open source distribution of a tool like snmpwalk. You need to know what you're looking for - i.e., the exact oid (object ID) string or else you get a long reply like you alluded to. It also helps to have the actual MIB you are querying against locally so that the output you get will be human-readable. Otherwise you'll get long numeric strings (the snmp oid) followed by alphanumeric values which may or may not make sense at first glance depending on the oid being queried. A MIB's purpose is to add that abstraction layer / interpretation to make the output more useful to the operator.
    The purpose of an NMS (very generally speaking) is to give an even higher layer of abstraction to organize the querying and reporting of all these various data into a useful system with dashboards, graphs, reports etc.

  • Replacing MacBook Pro's optical drive with SSD. What is the best way to migrate data?

    I have a time machine backup on external drive.
    I would like to:
    1. clean install Lion on the new SSD (120 GB)
    2. restore apps from my backup on the SSD
    3. keep only data on the existing HDD
    My questions:
    What is the best way to make it?
    Can I just keep the existing system on my non-SSD HDD, and after having Lion on SSD keep just data and delete the system libraries? Or is it better to format the whole disk and restore data from time machine backup (so it is not fragmented...).
    Thanks for any tips in advance!
    Antonin

    OK, thanks a lot.
    And after reformatting the old HDD can I - can I tell Time Machine where to recover my folders (apps --> SSD, data --> old HDD)?
    I mean when Time Machine starts recovering my 450 GB of files onto 120 GB SSD will it ask me to decide what put where?

  • What is the best way to create a bookmark for a returning user??

    Hello all... hello again Steve...I am back with another question- what is the best way to implement a bookmark system so returning users can pick up where they left off in an AW lesson? I have tried the usual internet searches, always do, but the few samples/answers I have found were AW5, not much help...
    I have a dozen or so maps attached to my framework, I would like a user to return to the last map he viewed before closing. (My AW is communicating fine with an Access database, so if passing a variable to Access and then back to AW when the lesson starts is on the right track, let me know...) If the answer here is too complicated, maybe nudge me in the right direction and I will dive back in.
    Thanks in advance to anyone who has some guidance, I really do appreciate it!
    Terry

    Try this outline, see if it helps ...
    Grab a reference to the Map as you enter it, then save that to the database when you leave.
    You want something that will give you the equivalent to a page number - if you have 7 maps hanging off the Framework, and the user is in the 6th map when he exits, you want to save the number 6.
    There are scores of ways to do this, but probably the easiest is just to attach a calc to each map that has this code
    (I don't have Authorwar handy to check syntax, so you should check!)
    BookMarkPage = ChildIDtoNum(IconParent(IconID), IconID) <-- tells Authorware to return the "page number" of the current map
    Save BookMarkPage to your Access database on exit .
    On return, read the bookmark back into BookMarkPage, ask the user if he wants to return to bookmark. If yes, use a calculated navigation that uses
    ChildNumToID(@the name of your Framework or it's ID, BookMarkPage)
    Note that you could wrangle something similar by saving the IconID of your Map, or the IconTitle, but both of these can break if you ever update your file by adding or removing pages, renaming them etc. With this method, all you need is a simple page count check that ensures that you are not trying to nav to a page number that does not exist (use IconNumChildren).
    Steve

  • I made an iMovie project with a bunch of stills and when I came back later today they had turned black like they weren't there. What's with that? How's the best way to fix it?

    I made an iMovie 10.0.4 project with a bunch of stills and when I came back later today they had turned black like they weren't there.
    Like this:
    When I play them they're black as well.
    Normal Still:
    "Missing" Still:
    What's with that? What's the best way to fix it?
    Thanks.

    Hi
    Magic solution - NO
    Some thoughts - YES
    Is the iPhoto Library still where it was previously (or on external Hard Disk - now turned off) ?
    One approach might be to - Repair iPhoto library (but this takes hours - so try below first)
    Trouble-shooting guide
    When iMovie doesn't work as intended this can be due to a lot of reasons
    iMovie Pref files got corrupted - trash it/they and iMovie makes new and error free one's
    problem in iMovie Cache folder - trash Cache.mov and Cache.plist
    Creating a new User-Account and log into this
    This forces iMovie to create all pref. and cache files new and error free
    Event or Project got corrupted - try to make a copy and repair
    a Codec is used that doesn't work (even though iMovie and/or iDVD tries to / they fail in the end)
    version miss match of QuickTime Player / iMovie / iDVD
    preferences are wrong - Repair Preferences
    other hard disk problem - Repair Hard Disk (Disk Util tool - but start Mac from ext HD or DVD)
    External hard disks - MUST BE - Mac OS Extended (hfs) formatted to work with Video
    ( UNIX/DOS/FAT32/Mac OS Exchange - works for most other things - but not for Video )
    USB-flash-memories - usually do not work
    Net-work connected hard disks - usually do not work (most often not fast enough and WRONGLY FORMATTES as DOS etc)
    iPhoto Library got problems - let iPhoto select another one or repair it. Re-build this first then try to re-start iMovie. When iMovie starts-up it first look trough this iPhoto library and if faulty it all Halt’s.
    This You do by
    First -  close iPhoto
    Secondly - on start up of iPhoto - Keep {cmd and alt-keys down}
    Thirdly - now select all five options presented
    THEN - WAIT a long long time (>20 hours are not strange)
    free space on Start-Up (Mac OS) hard disk to low (<1Gb) - I never go under 25Gb free space for SD-Video (4-5 times more for HD)
    external devices interferes - turn off Mac - disconnect all of them and - Start up again and re-try
    GarageBand fix - start GB - play a few notes - Close it again and now try iMovie
    Screen must be set to million-colors
    Third-party plug-ins doesn't work OK
    Run "Cache Out X", clear out all caches and restarts the Mac
    Let Your Mac be turned on during one night. At about midnight there is a set of maintenance programs that runs and tidying up. This might help
    Turn off Your Mac - and disconnect Mains - for about 20-30 minutes - at least this resets the FireWire port.
    In QuickTime - DivX, 3ivx codec, Flip4Mac, Perian etc - might be problematic - temporarily move them out and re-try
    (I deleted the file "3ivxVideoCodec.component" located in Mac HD/Library/Quicktime and this resolved my issue.)
    buenrodri wrote
    I solved the problem by removing the file: 3ivxVideoCodec.component. after that, up-dated iMovie runs ok.
    Last resort: Trash all of iMovie and re-install it
    Yours Bengt W

  • What is the best way to protect it?

    I HATE getting scratches or any sort of cosmetical damage on my devices, I am getting my first MBP on Friday, and want to know what the best way to keep it like new is?
    It won't be leaving the house regularly for a while, but I do have a neoprene case which I think it will fit for travelling anyway.
    I have seen many people with cases on their Macs, I don't know what the proper name is for them, but they are like hard shells attached to the back of the lid, are these recommended? I have read about some heat issues with it.
    What is the best way to protect the screen? I don't ever touch it, so I don't think that will be a problem, but cleaning dust off etc.?
    Lastly, will the trackpad wear away? My laptop's trackpad has slightly faded from it being used a lot, are MBP's prone to this too? I will try to use a mouse as much as possible.
    Are there any other things I should know about? I read that the bottom can get scratched easily too? I would only use it on a flat surface, so something like my lap, so depending on how soft the metal is... It can't be that bad can it?
    Thanks!

    Wouldnt buy that, nope
    Hard cases protect the finish of your macbook, but they trap in heat, ....many here have spoken on same.
    A major part of a macbook pro, especially a RETINA PRO is dissipating heat from the alloy case, which this case prevents from happening.
    Yes, youre stopping all the scratch,.....and likewise keeping the Macbook from dissipating a lot of heat.
    When I said INCASE, I meant this:
    http://www.amazon.com/Incase-CL57482-Nylon-Sleeve-13-Inch/dp/B0043NTOKC/ref=sr_1 _1?ie=UTF8&qid=1382551803&sr=8-1&keywords=incase+carry

  • What is the best way to Burn a DVD Movie

    What is the best way to Burn a DVD Movie, do I need a specific program?

    pamelafrommelbourne wrote:
    What is the best way to Burn a DVD Movie, do I need a specific program?
    If  you're trying to copy a commercial movie and burn it to disc, then it is expressly against the Terms of Use of this community to describe any method to illegally copy or circumvent copy protection DVD's
    If you've made a movie and want to author a DVD, then you should use iDVD, Toast or, if  you're really skilled, Final Cut Pro X. 
    If you just want to move a movie to a DVD, which probably won't play on a DVD player, then just insert a blank DVD, and move it over from the finder.  Click burn.

  • How to call a dialog program with return value in another dialog program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    You can you SET/GET parameters to do this.
    This is some information about this.
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETERstatements.
    To fill one, use:
    SET PARAMETER ID pid FIELD f.
    This statement saves the contents of field f under the ID pid in the SAP memory. The ID pid can be up to 20 characters long. If there was already a value stored under pid, this statement overwrites it. If you double-click pid in the ABAP Editor, parameters that do not exist can be created as a Repository object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID pid FIELD f.
    This statement places the value stored under the pid ID into the variable f. If the system does not find any value for pid in the SAP memory, sy-subrc is set to 4. Otherwise, it sets the value to 0.
    Thanks,
    SriRatna

  • What is the best way to verify default heap size in Java

    Hi All,
    What is the best way to verify default heap size in Java ? does it vary over JVM to JVM . I was reading this article http://javarevisited.blogspot.sg/2011/05/java-heap-space-memory-size-jvm.html , and it says default size is 128 MB but When I run following code :
    public static void main(String args[]) {
    int MB = 1024*1024;
    System.out.println(Runtime.getRuntime().totalMemory()/MB);
    It print "870" i.e. 870 MB.
    I am bit confused, what is the best way to verify default heap size in any JVM ?
    Edited by: 938864 on Jun 5, 2012 11:16 PM

    938864 wrote:
    Hi Kayaman,
    Sorry but I don't agree with you on verification part, Why not I can verify it ? to me default means value when I don't specify -Xms and -Xmx and by the way I was testing that program on 32 bit JRE 1.6 on Windows. I am also curious significant difference between 128MB and 870MB I saw, do you see anything obviously wrong ?That spec is outdated. Since Java 6 update 18 (Sun/Oracle implementation) the default maximum heap space is calculated based on total memory availability, but never more than 1GB on 32 bits JVMs / client VMs. On a 64 bits server VM the default can go as high as 32gb.
    The best way to verify ANYTHING is to address multiple sources of information and especially those produced by the source, not some page you find on the big bad internet. Even wikipedia is a whole lot better than any random internet site IMO. That's common sense, I can't believe you put much thought into it that you have to ask in a forum.

  • What is the best way of dealing with an "implicit coercion" of an array to a sprite?

    Hello everyone!
         With continued help from this forum I am getting closer to having a working program. I look forward to being able to help others like myself once I finish learning the AS3 ropes.
         I will briefly explain what I am trying to achieve and then follow it up with my question.
    Background
         I have created a 12 x 9 random number grid that populates each cell with a corresponding image based on each cell's numeric value. I have also created a shuffle button that randomizes the numbers in the grid. The problem I am running into is getting my button-click event to clear the current images off the grid in order to assign new ones (i.e. deleting the display stack objects in order to place news ones in the same locations).
    Question
         My question is this: what is the best way to handle an implicit coercion from an array to a sprite? I have pasted my entire code below so that you can see how the functions are supposed to work together. My trouble apparently lies with not being able to use an array value with a sprite (the sprite represents the actual arrangement of the grid on the display stack while the array starts out as a number than gets assigned an image which should be passed to the sprite).
    ============================================================================
    package 
    import flash.display.MovieClip;
    import flash.display.DisplayObject;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.utils.getDefinitionByName;
    public class Blanko extends MovieClip
          // Holds 12*9 grid of cells.
          var grid:Sprite;
          // Holds the shuffle button.
          var shuffleButton:Sprite;
          // Equals 12 columns, 9 rows.
          var cols:int = 12;
          var rows:int = 9;
          // Equals number of cells in grid (108).
          var cells:int = cols * rows;
          // Sets cell width and height to 40 pixels.
          var cellW:int = 40;
          var cellH:int = 40;
          // Holds 108 cell images.
          var imageArray:Array = [];
          // Holds 108 numerical values for the cells in the grid.
          var cellNumbers:Array = [];
          // Constructor calls "generateGrid" and "makeShuffleButton" functions.
          public function Blanko()
               generateGrid();
               makeShuffleButton();
      // Creates and displays the 12*9 grid.
      private function generateGrid():void
           grid = new Sprite;
           var i:int = 0;
           for (i = 0; i < cells; i++)
                cellNumbers.push(i % 9 + 1);
           trace("Before shuffle: ", cellNumbers);
           shuffleCells(cellNumbers);
           trace("After shuffle: ", cellNumbers);
           var _cell:Sprite;
           for (i = 0; i < cells; i++)
                // This next line is where the implicit coercion occurs. "_cell" is a sprite that tries
                   to temporarily equal an array value.
                _cell = drawCells(cellNumbers[i]);
                _cell.x = (i % cols) * cellW;
                _cell.y = (i / cols) * cellH;
                grid.addChild(_cell);
      // Creates a "shuffle" button and adds an on-click mouse event.
      private function makeShuffleButton():void
           var _label:TextField = new TextField();
           _label.autoSize = "center";
           TextField(_label).multiline = TextField(_label).wordWrap = false;
           TextField(_label).defaultTextFormat = new TextFormat("Arial", 11, 0xFFFFFF, "bold");
           _label.text = "SHUFFLE";
           _label.x = 4;
           _label.y = 2;
           shuffleButton = new Sprite();
           shuffleButton.graphics.beginFill(0x484848);
           shuffleButton.graphics.drawRoundRect(0, 0, _label.width + _label.x * 2, _label.height +
                                                _label.y * 2, 10);
           shuffleButton.addChild(_label);
           shuffleButton.buttonMode = shuffleButton.useHandCursor = true;
           shuffleButton.mouseChildren = false;
           shuffleButton.x = grid.x + 30 + grid.width - shuffleButton.width;
           shuffleButton.y = grid.y + grid.height + 10;
           this.addChild(shuffleButton);
           shuffleButton.addEventListener(MouseEvent.CLICK, onShuffleButtonClick);
      // Clears cell images, shuffles their numbers and then assigns them new images.
      private function onShuffleButtonClick():void
       eraseCells();
       shuffleCells(cellNumbers);
       trace("After shuffle: ", cellNumbers);
       for (var i:int = 0; i < cells; i++)
        drawCells(cellNumbers[i]);
      // Removes any existing cell images from the display stack.
      private function eraseCells(): void
       while (imageArray.numChildren > 0)
        imageArray.removeChildAt(0);
      // Shuffles cell numbers (randomizes array).
      private function shuffleCells(_array:Array):void
       var _number:int = 0;
       var _a:int = 0;
       var _b:int = 0;
       var _rand:int = 0;
       for (var i:int = _array.length - 1; i > 0; i--)
        _rand = Math.random() * (i - 1);
        _a = _array[i];
        _b = _array[_rand];
        _array[i] = _b;
        _array[_rand] = _a;
      // Retrieves and assigns a custom image to a cell based on its numerical value.
      private function drawCells(_numeral:int):Array
       var _classRef:Class = Class(getDefinitionByName("skin" + _numeral));
       _classRef.x = 30;
       imageArray.push(_classRef);
       imageArray.addChild(_classRef);
       return imageArray;
    ===========================================================================
         Any help with this is greatly appreciated. Thanks!

    Rothrock,
         Thank you for the reply. Let me address a few things here in the hopes of allowing you (and others) to better understand my reasoning for doing things in this manner (admittedly, there is probably a much better/easier approach to what I am trying to accomplish which is one of the things I hope to learn/discover from these posts).
         The elements inside my "imageArray" are all individual graphics that I had imported, changed their type to movie clips using .Sprite as their base class (instead of .MovieClip) and then saved as classes. The reason I did this was because the classes could then be referenced via "getDefinitionByName" by each cell value that was being passed to it. In this grid every number from 1 to 9 appears randomly 12 times each (making the 108 cells which populate the grid). I did not, at the time (nor do I now), know of a better method to implement for making sure that each image appears in the cell that has the corresponding value (i.e. every time a cell has the value of 8 then the custom graphic/class "skin8" will be assigned to it so that the viewer will be able to see a more aesthetically pleasing numerical representation, that is to say a slightly more fancy looking number with a picture behind it). I was advised to store these images in an array so that I could destroy them when I reshuffle the grid in order to make room for the new images (but I probably messed up the instructions).
         If the "drawCell" function only returns a sprite rather than the image array itself, doesn't that mean that my "eraseCells" function won't be able to delete the array's children as their values weren't first returned to the global variable which my erasing function is accessing?
         As for the function name "drawCells," you have to keep in mind that a) my program has been redesigned in stages as I add new functionality/remove old functionality (such as removing text labels and formatting which were originally in this function) and b) that my program is called "Blanko."
         I will try and attach an Illustrator exported JPG file that contains the image I am using as the class "skin7" just to give you an example of what I'm trying to use as labels (although it won't let me insert it here in this post, so I will try it in the next post).
    Thank you for your help!

  • What is the best way to call SSH commands through Java technologies

    What is the best way to call SSH commands through Java technologies

    I don't think you can specify the password at the prompt using ssh. Plink has the -pw command option for passwords. What I did was except ssh to ask me and write the password programmatically through the outputStream I obtained from my Process object. I looked for "password: ", and then wrote the password with a trailing newline.
    Both plink and ssh will also ask if you trust the host if it is the first time you are connecting to it. So before just writing the password, check if the program wants verification from you: normally supplying "y" or "n". This should only have to happen the first time the client connects. It looks like thisPLINK:
    The server's host key is not cached in the registry. You
    have no guarantee that the server is the computer you
    think it is.
    The server's key fingerprint is:
    1024 f8:43:61:4c:a2:5b:77:be:5b:a7:bb:1f:f7:79:b3:b7
    If you trust this host, enter "y" to add the key to
    PuTTY's cache and carry on connecting.
    If you want to carry on connecting just once, without
    adding the key to the cache, enter "n".
    If you do not trust this host, press Return to abandon the
    connection.
    Store key in cache? (y/n)
    SSH:
    The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
    RSA key fingerprint is e1:02:13:c8:52:c2:23:41:9b:5b:58:2c:18:e6:59:af.
    Are you sure you want to continue connecting (yes/no)?What I did was read character by character from the inputStream until I found things of interest ... like "password: ". You only need to search for this in your method which will launch the ssh or plink Process. Once you have verifyed yourself, you can just pass commands to the Process, which is an ssh connection.
    My suggestion is to read() each byte from the Process's inputStream and write it to stdout. Look and see what you need to be looking for so you can interactive with the program correctly. You can't use readLine here becuase when the ssh asks for the password it does not print a newline. I do know for sure, that ssh will simply print, "passowrd: ". Plink will print this as well if the -pw option is not supplied.

  • What is the best way of returning group-by sql results in Toplink?

    I have many-to-many relationship between Employee and Project; so,
    a Employee can have many Projects, and a Project can be owned by many Employees.
    I have three tables in the database:
    Employee(id int, name varchar(32)),
    Project(id int, name varchar(32)), and
    Employee_Project(employee_id int, project_id int), which is the join-table between Employee and Project.
    Now, I want to find out for each employee, how many projects does the employee has.
    The sql query that achieves what I want would look like this:
    select e.id, count(*) as numProjects
    from employee e, employee_project ep
    where e.id = ep.employee_id
    group by e.id
    Just for information, currently I am using a named ReadAllQuery and I write my own sql in
    the Workbench rather than using the ExpressionBuilder.
    Now, my two questions are :
    1. Since there is a "group by e.id" on the query, only e.id can appear in the select clause.
    This prevent me from returning the full Employee pojo using ReadAllQuery.
    I can change the query to a nested query like this
    select e.eid, e.name, emp.cnt as numProjects
    from employee e,
    (select e_inner.id, count(*) as cnt
    from employee e_inner, employee_project ep_inner
    where e_inner.id = ep_inner.employee_id
    group by e_inner.id) emp
    where e.id = emp.id
    but, I don't like the complication of having extra join because of the nested query. Is there a
    better way of doing something like this?
    2. The second question is what is the best way of returning the count(*) or the numProjects.
    What I did right now is that I have a ReadAllQuery that returns a List<Employee>; then for
    each returned Employee pojo, I call a method getNumProjects() to get the count(*) information.
    I had an extra column "numProjects" in the Employee table and in the Employee descriptor, and
    I set this attribute to be "ReadOnly" on the Workbench; (the value for this dummy "numProjects"
    column in the database is always 0). So far this works ok. However, since the numProjects is
    transient, I need to set the query to refreshIdentityMapResult() or otherwise the Employee object
    in the cache could contain stale numProjects information. What I worry is that refreshIdentityMapResult()
    will cause the query to always hit the database and beat the purpose of having a cache. Also, if
    there are multiple concurrent queries to the database, I worry that there will be a race condition
    of updating this transient "numProjects" attribute. What are the better way of returning this kind
    of transient information such as count(*)? Can I have the query to return something like a tuple
    containing the Employee pojo and an int for the count(*), rather than just a Employee pojo with the
    transient int inside the pojo? Please advise.
    I greatly appreciate any help.
    Thanks,
    Frans

    No I don't want to modify the set of attributes after TopLink returns it to me. But I don't
    quite understand why this matters?
    I understand that I can use ReportQuery to return all the Employee's attributes plus the int count(*)
    and then I can iterate through the list of ReportQueryResult to construct the Employee pojo myself.
    I was hesitant of doing this because I think there will be a performance cost of not being able to
    use lazy fetching. For example, in the case of large result sets and the client only needs a few of them,
    if we use the above aproach, we need to iterate through all of them and wastefully create all the Employee
    pojos. On the other hand, if we let Toplink directly return a list of Employee pojo, then we can tell
    Toplink to use ScrollableCursor and to fetch only the first several rows. Please advise.
    Thanks.

Maybe you are looking for

  • I installed the eprint home and biz app on my ipad. how can i print from my jetpro wireless printer

    My iPad just states no printer found with air print. Is this an app that I need and will work with my wireless jet pro 8500

  • Authorize charged not made by me

    what is it  ? this so many time i been complained and its the same thing the same product. I didnt order or purchase for this product but it keep charging from my credit card all the time. i need this to stop and i need my refund. im totally not happ

  • Best Practice Two ISPs and BGP

    Hello Experts. I was wanting to hear opinions for the best way to setup two ISR4431's with two 2960x's and two ASA firewalls. My current design is: ISP1 router -> ISR4431-A ->{2960x pair} -> ASA-A ISP2 router -> ISR4431-B ->{2960x pair} -> ASA-B Curr

  • Remove halo around spry tabbed panels tab

    I am using a spry tabbed panel on my page.  In Safari, whem I click on a tab, the tab is surrounded by a halo.  I assume this halo is some Safari default rendering.  Anyone now how to get rid of this halo?  I'm guessing it can be done with a css stat

  • Sales order confirmation based on Consignment stock only.

    Hi All, i have a requirement at my client. they want the SO to be confirmed based on the consignment stock only (no other stock like unrestriected etc). i tried my best ans waiting for response from your side. i tried to create a requirement class wi