Show truly dangerous to call from main?

In this JDC tutorial
http://java.sun.com/developer/JDCTechTips/2003/tt1208.html#1
the author claims that it is dangerous to call a Frame's show method from the thread executing your program's main, which is probably how 99% of us do it. Instead he claims that to be truly multithread safe, you need to call show from the AWT event thread using the invokeLater mechanism.
Is this really true? Does anyone know of a good discussion of this elsewhere? And if so, then how come Sun does not document it, say, in the show method? It is a disgrace to not mention such a critical fact right in the method itself if it is truly necessary.
I presume that if the author's point is true, then it holds for any Window or subclass (e.g. Dialog as well as Frame)?
Finally: if you truly do need to call show on the AWT event thread, then what about calling pack? (Contrary to what his article seems to say, calling show does NOT seem to automaticly call pack, at least for Frames.) Should you also only call pack from the event thread too? And are there any other methods that should only be called from the event thread?

I would question the true risk here. What the author of the article is describing is creating more frames or dialogs from the main thread. However the creation of the initial frame is pretty safe to call show on from your primary thread.
In general it is always a good practice to do all GUI related work in the event thread. Updating fields/labels, etc. should be done in the event thread and therefore calling show on a sub frame or dialog should also be done in the event thread.

Similar Messages

  • Sub VI to enter database data taking more time when calling from main VI

    Hi All,
    I created a sub vi to enter data to a new database, after reading from another database. when i executed that sub vi alone, it took only 2 minutes to enter 20000 records. But when i called that sub VI from my main VI, its taking 35 minutes to enter 20000 records. 
    my maiin vi has another while loop running parallelly which will perform some other operations. How to handle memory in this case? i mean when i call my sub vi from main vi, i need to give complete processor memory for that sub vi. is it possible?
    please help. thanks in advance.
    Sooraj

    Hi Oliver,
    in your example the numeric data is passed from sub-vi to main only when sub-vi terminates, this is what it's supposed to be when you fetch the data from the connector output of a sub-vi.
    You can use queues function to exchange data between sub-vi and main.vi; take a look at the example Message Logging with Named Queue.vi.
    An alternative method is passing to sub-vi a reference of an indicator (or control) and update its value on the fly.
    See example.
    Alberto
    Attachments:
    passing_data_from_sub-vi.llb ‏35 KB

  • Loading independent sub vis in sub panels and calling from main vi

    Hi all,
    I have trying to work on the following requirement.
    I have a main vi with a file browzer and sub panel - Channel . I will select a channel configuration text file which contains Analog and digital channels names. ''
    My vi will read that file and loads and Channel VI in the sub panel - Channel.
    Now the CHANNEL VI has a tab control with 2 pages analog and digital. Each page again has sub panels i,e. sub Panel - Analog and sub-Panel-Digital.
    Analog VI with some knob controls which are binded to Signals are displayed in the sub Panel - Analog.
    Digital VI with some boolean controls  which are binded to Signals are displayed in the sub Panel - Digital.
    These vis will show the values acquired from the hardware.
     I want to provide the user to load any channel configuration file and acquire the data. For the first time the execution is working fine. The next time when I tried to load a new configuration file. it says "Invoke node in main cvi <Append> Method Name <b>Run VI</b> and the new configuration is not loaded.
    The following logic is implemented as a sub vi to load and close the sub panel vi.
    VI Load logic:
    VI CLose Logic
    So please let me know where am i doing wrong.
    Before loading the new configuration file Iam calling the close logic . But still is not working.
    Thanks in Advance.
    Ramesh.

    Can you post a vi snippet? It would be helpful to see your logic flow, I'm wondering if your problem is that you've got "remove vi" node at the end after you have already closed the vi reference - but can't tell if same vi reference are used as in the case of top diagram.
    -DP
    New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI

  • Can I disable "Slide to Call" from main screen?  Forced to take call on accidental swipe

    I have an iPhone 4s with iOS7 and I seriously do not like the "Slide to Call" feature from the main screen and would like to disable it.  I would still like to see notifications on the home screen.  I have accidentally swiped a call amongst other notifications and NO FUNCTION BUTTONS POP UP TO LET ME CANCEL THE CALL!.  Seriously.  A blank screen.  I make an accidental swipe and now have to talk to someone I didn't want to talk to at the time.
    Let me better describe the situation.
    The 4s phone was locked.  I had received a call and a text which were displayed on the home screen.  I attempted to swipe the text, but hit the call.  NO BUTTON, I had a blank screen and the call was going off in the 4s ear piece.  I had to take the call or look totally stupid.  I was just so angry that there was no way for me to end the call.  In the second after the connection was made, after having held it to my ear and moved it away a few times, the buttons (End, speaker, etc) finally appeared. 

    You can always press the Sleep/Wake button.
    If you have the iPhone ear-phones on, you can press the the remote button also.

  • Screen does not seem to reflect changes when called from main program.....

    Hi all,
            here's an issue that i've been trying to solve for a few days now,
    i had created a screen in the screen painter, inside which i've included a table control (screen number 100: ).
    i, then created a second screen pointing to the same program as screen 100 and assigned screen number 200 to it. so both scrn 100 and scrn 200 has got table controls and the validations occur in modules from the same program.
    the issue i face is that, while any changes i make in screen 100 works fine when i call screen 100 from the main program;  it does not work when i try to modify the table control in screen 200. for example, if i were to add a new column, it messes up the allignment of the other columns in screen 200, i can't seem to assign fixed colums, etc....
    has anyone come across similar issues? if so how can i solve it? could it be an error with the SAP GUI?
    any response will be appreciated. points will be rewarded as well... if that's how things work here.
    Thanks,
    David.
    Edited by: david joseph on Aug 14, 2008 2:33 AM

    >
    david joseph wrote:
    > Hi all,
    >         here's an issue that i've been trying to solve for a few days now,
    > i had created a screen in the screen painter, inside which i've included a table control (screen number 100: ).
    >  i, then created a second screen pointing to the same program as screen 100 and assigned screen number 200 to it. so both scrn 100 and scrn 200 has got table controls and the validations occur in modules from the same program.
    >
    > the issue i face is that, while any changes i make in screen 100 works fine when i call screen 100 from the main program;  it does not work when i try to modify the table control in screen 200. for example, if i were to add a new column, it messes up the allignment of the other columns in screen 200, i can't seem to assign fixed colums, etc....
    >
    > has anyone come across similar issues? if so how can i solve it? could it be an error with the SAP GUI?
    >
    > Thanks,
    > David.
    >
    > Edited by: david joseph on Aug 14, 2008 2:33 AM
    Hi David,
    The description of the problem is not so clear.
    Let me know where I'm wrong, you have 2 screens and 2 different tablecontrols ? When you do any changes from the sapgui to the screen 100 there is no problem. But when you do that to the screen 200 is messes up ?
    My logic with table controls
    if you want 2 screens to share the same control then add the control to a subscreen
    when you want to have 2 screens with 2 differents controls :
    in main program
    CONTROLS : tc_100 type TABLEVIEW USING SCREEN 100.
    CONTROLS : tc_200 type TABLEVIEW USING SCREEN 200.
    In screen 100 / 200 assure the name of the controls are tc_100 / tc_200....
    Using this method I never have any problem....

  • How to close a window that is called from main window?

    hi....
    I have a main window that calls a second window, but when I close the second window all my application end. I just want the second window returns to main window. how do I do it?

    Set the onClose behaviour: ... something like setDefaultCloseOperation
    dont exist, instead dispose.
    In addition you could attach a listener to the windowClosing event

  • Is it possible to modify private member of a class directly from main?

    This is the code which modifies the private String stk[] indirectly from main method when sorting option is called from main method:
    import java.io.*;
    class Stack
        private String stk[];
        private int tos;
        private int size;
        Stack()
            size=5;
            stk=new String[size];
            tos=-1;
        Stack(int sz)
            size=sz;
            stk=new String[size];
            tos=-1;
        boolean push(String s)
            if(tos==size-1) return false;
            stk[++tos]=s;
            return true;
        String pop()
            if(tos<0) return "Stack Underflow";
            return stk[tos--];
        String[] display()//array type function to return an array called "stk"
            return stk;
        int returnSize()
            return tos;
    class myStack
        public static void main(String args[]) throws IOException
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            Stack S=new Stack();
            int opt=-1;
            while(opt!=6)
                System.out.println("\n\n\n");
                System.out.println("[1] - Create Stack");
                System.out.println("[2] - Push");
                System.out.println("[3] - Pop");
                System.out.println("[4] - Display");
                System.out.println("[5] - Display List In Ascending Order");
                System.out.println("[6] - Exit");
                System.out.print("Option: ");
                opt=Integer.parseInt(br.readLine());
                if(opt==1)
                    System.out.print("\n\nEnter the size of stack: ");
                    int size=Integer.parseInt(br.readLine());
                    S=new Stack(size);
                    System.out.print("\nStack Created...");
                else if(opt==2)
                    System.out.print("\n\nEnter String: ");
                    String s=br.readLine();
                    if(S.push(s))
                        System.out.print("\nSuccessfull...");
                    else
                        System.out.print("\nStack Overflow...");
                else if(opt==3)
                    System.out.print("\nItem Deleted: "+S.pop());
                else if(opt==4)
                    int sz=S.returnSize();
                    System.out.print("\n\n\nStack Contains: "+(sz+1)+" Item(s)\n");
                    String st[]=S.display();
                    while(sz>=0)
                        System.out.println(st[sz]);
                        sz--;
                else if(opt==5)
                    int s=S.returnSize();
                    String stc[]=S.display();
                    for(int i=0;i<=s;i++)
                        for(int j=i+1;j<=s;j++)
                            if(stc[j].compareTo(stc[i])<0)
                                String t=stc[i];
                                stc[i]=stc[j];
                                stc[j]=t;
                    System.out.println(stc[i]);
                else if(opt>6)
                    System.out.print("\nPress 6 To Exit....");

    Actually, since it is returning the reference value of the array, and he is changing the array elements using that reference, then he IS "changing the array".
    @OP:  When you return a reference value to an object (and, in this regard, an array IS an object), then use that reference value to change things in the object (NOT assigning a new value to the variable holding that reference value), then, of course, those items are changed, and everything using that same reference value will "see" those changes, as they ALL point to the SAME object.
    Edit:  My first answer was going under the assumption that you meant DIRECTLY changing (i.e. stk = ...) since all you provided was the "title" and a blurb of code.  Next time you should think about actually providing some information about the actual "problem".
    See http://www.javaranch.com/campfire/StoryCups.jsp (to get associated with the "terms" they use)
    then see http://www.javaranch.com/campfire/StoryPassBy.jsp for some easy to understand explanations of reference values and objects.

  • Is it possible to modify private member of a class directly from main function?

    This is the code which modifies the private String stk[] indirectly from main method when sorting option is called from main method:
    import java.io.*;
    class Stack
        private String stk[];
        private int tos;
        private int size;
        Stack()
            size=5;
            stk=new String[size];
            tos=-1;
        Stack(int sz)
            size=sz;
            stk=new String[size];
            tos=-1;
        boolean push(String s)
            if(tos==size-1) return false;
            stk[++tos]=s;
            return true;
        String pop()
            if(tos<0) return "Stack Underflow";
            return stk[tos--];
        String[] display()//array type function to return an array called "stk"
            return stk;
        int returnSize()
            return tos;
    class myStack
        public static void main(String args[]) throws IOException
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            Stack S=new Stack();
            int opt=-1;
            while(opt!=6)
                System.out.println("\n\n\n");
                System.out.println("[1] - Create Stack");
                System.out.println("[2] - Push");
                System.out.println("[3] - Pop");
                System.out.println("[4] - Display");
                System.out.println("[5] - Display List In Ascending Order");
                System.out.println("[6] - Exit");
                System.out.print("Option: ");
                opt=Integer.parseInt(br.readLine());
                if(opt==1)
                    System.out.print("\n\nEnter the size of stack: ");
                    int size=Integer.parseInt(br.readLine());
                    S=new Stack(size);
                    System.out.print("\nStack Created...");
                else if(opt==2)
                    System.out.print("\n\nEnter String: ");
                    String s=br.readLine();
                    if(S.push(s))
                        System.out.print("\nSuccessfull...");
                    else
                        System.out.print("\nStack Overflow...");
                else if(opt==3)
                    System.out.print("\nItem Deleted: "+S.pop());
                else if(opt==4)
                    int sz=S.returnSize();
                    System.out.print("\n\n\nStack Contains: "+(sz+1)+" Item(s)\n");
                    String st[]=S.display();
                    while(sz>=0)
                        System.out.println(st[sz]);
                        sz--;
                else if(opt==5)
                    int s=S.returnSize();
                    String stc[]=S.display();
                    for(int i=0;i<=s;i++)
                        for(int j=i+1;j<=s;j++)
                            if(stc[j].compareTo(stc[i])<0)
                                String t=stc[i];
                                stc[i]=stc[j];
                                stc[j]=t;
                    System.out.println(stc[i]);
                else if(opt>6)
                    System.out.print("\nPress 6 To Exit....");

    Short answer is: no.
    Long answer is: you should not try to. Information hiding is the fundamental principle of OOP. This means that the code dealing with an object has no knowledge about the objects inner structure. It only knows the methods provided by its interface.
    You should declare all object properties private and prevent any other code outside the owning class to manipulate it. This includes leaking properties via "getter" methods. In your example the display() method is bad in two ways:
    its name does not convey its purpose.
    it a "getter" that returns the private property stk to the caller who may change it. Eg. the caller could add or delete an entry without changing tos accordingly.
    bye
    TPD

  • Calling Classes main method

    I have two classes, I want to create a new instance of Class B and run it's main method...not sure if I'm being clear. Any help is greatly appreciated :)

    Actually, I have Class A that sends an email with an attachment, copies the File into another folder (backup), and deletes the old file. Class B deletes all backed-up files with a last modified greater than 30 days. I wish to run Class B's main method from Class A....somewhat of a method call (main method).
    Do I just have to import the DeleteFile and create a new instance of DeleteFile? I'm just getting back into the swing of java and have forgotten :)
    Also, do you know how to place a timer around a Delete method? I'm calling the following methods in a row, but my Delete method will only delete on the very first iteration....although the Copy, SendEnrollMail works properly everytime...hmmmm? I've looked throughout support, but cannot find exactly what I'm looking for.
    // Import packages/classes
    import IKEvent;
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import java.text.*;
    // Class declaration
    class StringToken{
    // Static method called from main method - can't instantiate
    public static void copyFile(String aOldFile, String aNewFile, String aAttachment)throws IOException{
    // Local variables
    String oldFile = aOldFile;
    String newFile = aNewFile;
    String attachment = aAttachment;
    String currentDate = "";
    // Instantiate a Date object
    Date myDate = new Date();
    // Convert myDate(long) to String
    currentDate = myDate.toString();
    // Format currentDate variable
    SimpleDateFormat format = new SimpleDateFormat("dd_MM_yyyy");
    currentDate = format.format(new Date());
    // Copy instructor report
    File inputFile = new File(oldFile);
    File outputFile = new File(newFile + currentDate + "_" + attachment);
    FileInputStream in = new FileInputStream(inputFile);
    FileOutputStream out = new FileOutputStream(outputFile);
    int c;
    while ((c = in.read()) != -1)
    out.write(c);
    in.close();
    out.close();
    // Static method called from main method - can't instantiate
    public static void deleteFile(File aDeletedFile)throws IOException{
    // Local variables
    File delFile = aDeletedFile;
    // Delete the instructor report
    delFile.delete();
    // sendEnrollMail method
    public static boolean sendEnrollMail(String aSmtpServer, String anEmail, String aFirstName, String aLastName, String logFile, String ccAddress, String aCourseSession, String aFileName, String aReportDir)throws IOException{
    // Local variables
    Properties props = System.getProperties();
    String mailServer = aSmtpServer;
    String crseSession = aCourseSession;
    String emailAddress = anEmail;
    String firstName = aFirstName;
    String lastName = aLastName;
    String filename = aFileName;
    String reportDir = aReportDir;
    // Begin error checking
    try{
    // SMTP protocol, relays message to the SMTP server of the recipient(s)
    // eventually to be acquired by the user(s) through POP or IMAP
    props.put ("mail.smtp.host", mailServer);
    // Instantiate a basic mail session object, uses java.util.Properties
    Session emailsession = Session.getDefaultInstance(props, null);
    // Create a message, pass along the session object to the MimeMessage constructor
    Message email = new MimeMessage(emailsession);
    // Set from of email - administration
    InternetAddress fromAddress = new InternetAddress(ccAddress, "Name");
    email.setFrom(fromAddress);
    // Set recipient(s) of email
    InternetAddress[] address = {new InternetAddress(emailAddress), new InternetAddress(ccAddress)};
    email.setRecipients(Message.RecipientType.TO, address);
    // Set subject/date
    email.setSubject("Evaluations Results Report for Session " + crseSession);
    email.setSentDate(new Date());
    // Fill the message
    StringBuffer welcomeMessage = new StringBuffer();
    welcomeMessage.append("Hi ").append(firstName + " " + lastName + ":"+'\n'+'\n');
    welcomeMessage.append("The Evaluations Results Report for Session " + crseSession + " has been attached to this email. If you have any problems accessing the file, please contact aName at there-email."+'\n'+'\n');
    // Creation of message part
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText(welcomeMessage.toString());
    // Create a multipart
    Multipart multipart = new MimeMultipart();
    // Part one is inputting the text of the message
    multipart.addBodyPart(messageBodyPart);
    // Part two is attachment
    // Create second body part, attachment
    messageBodyPart = new MimeBodyPart();
    // Get the attachment
    DataSource source = new FileDataSource(reportDir + filename);
    // Set the data handler to the attachment
    messageBodyPart.setDataHandler(new DataHandler(source));
    // Set the filename
    messageBodyPart.setFileName(filename);
    // Add part two
    multipart.addBodyPart(messageBodyPart);
    // Put parts in message
    email.setContent(multipart);
    // Send the message
    Transport.send(email);
    // Append the log file with success
    FileOutputStream fout = new FileOutputStream ( logFile , true );
    PrintStream pout = new PrintStream (fout);
    // Log a successful email
    pout.println ('\r');
    pout.println (new java.util.Date() + " - Send Enroll Email Successful!");
    pout.println ("email: " + emailAddress);
    pout.println ("first name: " + firstName);
    pout.println ("last name: " + lastName);
    pout.close();
    // End of error checking for sendEnrollMail function
    catch (MessagingException e) {
    // Append the log file with failure
    FileOutputStream fout = new FileOutputStream ( logFile , true );
    PrintStream pout = new PrintStream (fout);
    // Print message to log upon failure
    pout.println ('\r');
    pout.println (new java.util.Date() + " - Send Enroll Email Failure!");
    pout.println ("email: " + emailAddress);
    pout.println ("first name: " + firstName);
    pout.println ("last name: " + lastName);
    pout.close();
    return false;
    Thank you!

  • I am recieving calls from a solicitor. Show up as no caller Id. I want to block all calls that do not show caller Id. Can I do that? I am on the do not call list

    How do I block all in coming calls that do not show on my caller Id. Phone says "no caller id" This particular call is from a place selling septic tank cleaner. They leave an automated voice mail. They are calling me over and over. I am on the national do not call list but that's no help. Because the caller id doesn't show anything I can't even report them.
    I remember in the past calling a number and before my call would go thru I would have to enter my phone number so the party I was calling knew who was calling them. That is what I want to do. I want to block all calls from "no caller id" "number unavailable" Just FYI my phone is an IPHONE 5 and I am on Verizon.
    Any help would be appreciated.
    Thanks

        itbitybob, good day!
    Thank you for taking the time to reach out to us today. I know how frustrating it can be getting phone calls from "no caller id" numbers. We do have an option that is called Family Base that will allow you to block unknown numbers, private numbers, or caller id. This link will provide you with the full details of this option. http://vz.to/1gIklla I hope this is able to answer your question. If you have further questions please feel free to reach back out to us at any time.
    KevinR_VZW
    Please follow us on Twitter @VZWSupport 

  • Call function, pass value, access variable in movieclip class from main stage

    i am new to flash as.
    I got quite confused on some problems. as the function here
    is quite different from c and asp.net.
    I have a movieClip named MC, and it's enabled with action
    script, with the class name MC_Rectangle
    and a Stage.
    I override the MC_Rectangle class file in a mc_rectangle.as
    external file.
    here is the code:
    package{
    import flash.display.*;
    import flash.events.*;
    public class MC_Rectangle extends MovieClip {
    var sequence:int = new int();
    function setSequence(data:int):void{
    sequence = data;
    function addSequence():void{
    sequence ++;
    I have new a object in the main stage var
    mc_rect:MC_Rectangle = new MC_Rectangle()
    question:
    in main stage:
    1. how can i access the variable "sequence" in "mc_rect"
    2. how can i pass parametre from main stage to mc_rect via
    function setSequence(data:int)?
    3. how can i call the function in addSequence() in mc_rect.
    in asp.net, i usually use mc_rect.sequenct,
    mc_rect.setSequence(data), mc_rect.addSequence() to achieve my
    goals......
    btw, can function in mc_rect return out result to main stage?
    thanks in advance.

    Your as-file must be named MC_Rectangle.as (same upper/lower
    case as in the Class name)
    Ad 1) You have to declare sequence as a public property
    "public var sequence;" or - better - define a getter-function for
    sequence.
    Ad 2) mc_rect.setSequence(8); e. g. (you must write "public"
    in the Class-declaration of setSequence)
    Ad 3) mc_rect.addSequence(); e. g. (you must write "public"
    in the Class-declaration of addSequence)
    ... and yes, your methods can return a value: Replace "void"
    with the proper data type (int, String, ...) and place a "return
    myNumber;" or the like in the method's body.

  • Calls from my iPhone 5 always show up as "Private" or "Blocked".

    Calls from my iPhone 5 always show up as Private or Blocked when I call someone else.  (My ID is normal when I text them though.)  I've looked but can't find anything in the phone Settings that would fix this.  Am I missing it or is there a bigger problem?

    Settings > Phone >Show My Caller ID to On.

  • Subtemplate footer is not coming when calling from the main template

    Hi All,
    The footer from the subtemplate is not coming in the output when calling from the main template. Does anybody worked on the subtemplate?
    If the same footer is put in the main template, it is displaying.
    Please respond as this is a critical issue for us.
    Thanks,
    Ambadas

    Hi Tim,
    Thanks for your reply. Here is syntax which I got from the Oracle BI Publisher blog. And this is to just test locally.
    http://blogs.oracle.com/xmlpublisher/2006/04/11?import:file:///C:/temp/HeaderFooter.rtf
    <?import:file:///d:/test/GEPOPRINT_GER_GER.rtf?>
    <?import:file:///d:/test/GEPOPRINT_US.rtf?>
    <?for-each@section:G_HEADERS?>
    <?if:POH_REPORT_NAME='GER PO w/GERMAN Data'?>
    <?call-template:PO_GERMAN?>
    <?end if?>
    <?if:POH_REPORT_NAME='US Purchase Order'?>
    <?call-template:PO_US?>
    <?end if?>
    <?End for-each?>
    And I don't have any footers in the main template but in the subtemplate I have the respective footers. If you want, I can send all the RTF's to you directly.
    Let me know.
    Thanks,
    Ambadas

  • Problem when calling session bean from main.

    Hi everyone
    I get the following error when calling a session bean from main(String args[]).
    Sep 3, 2008 9:11:13 AM com.sun.enterprise.appclient.MainWithModuleSupport <init>
    WARNING: ACC003: Application threw an exception.
    java.lang.NullPointerException
    at databasetest.Main.main(Main.java:26)
    Here is my code beneath.
    I'm using netbeans and glassfish application server.
    Everything is in the same project, called DatabaseTest, I also have deployed the application before running the client.
    I'm running the client as follows, right click on the DatabaseTest-app-client and select run.
    The client:
    package databasetest;
    import com.test.UsersFacadeRemote;
    import javax.ejb.EJB;
    import com.test.Users;
    public class Main {
        @EJB
        private static UsersFacadeRemote usersFacade;
        public static void main(String[] args) {
            Users users = new Users(12, 34);
            usersFacade.create(users);
    }The remote facade I'm calling:
    package com.test;
    import java.util.List;
    import javax.ejb.Remote;
    @Remote
    public interface UsersFacadeRemote {
        void create(Users users);
        void edit(Users users);
        void remove(Users users);
        Users find(Object id);
        List<Users> findAll();
    }The stateless bean:
    package com.test;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless
    public class UsersFacade implements UsersFacadeRemote {
        @PersistenceContext
        private EntityManager em;
        public void create(Users users) {
            em.persist(users);
        public void edit(Users users) {
            em.merge(users);
        public void remove(Users users) {
            em.remove(em.merge(users));
        public Users find(Object id) {
            return em.find(com.test.Users.class, id);
        public List<Users> findAll() {
            return em.createQuery("select object(o) from Users as o").getResultList();
    }

    looks like you're banging your head against the same brick wall as [I have done|http://forums.sun.com/thread.jspa?forumID=13&threadID=5317110] and [others have in the past|http://forums.sun.com/thread.jspa?forumID=136&threadID=5259913] if that's any consolation.
    Funny thing is, mine did actually work in the debugger but not when running!
    Strange thing that.
    I did initially interest someone from the developers but they couldn't really help, ended up saying : try instantiating your beans the EJB 2.1 way and see where that gets you. Yes that works but they promised us "hey no more dopey xml deployment descriptors just some cool annotations" didn't they?
    I've got the feeling were' missing something really obvious!
    Edited by: sebthebike on 03-Sep-2008 12:21

  • HT3965 How do I change the ID that shows on other people's phones when I call from my iPhone five

    How do I change ID that shows on other people's phones when I call from my iPhone5?

    my son had this problem.  I went to the apple store and they wiped out and restored the phone..  They said that was all they could do but that I should call our phone carrier and ask them.  I did.  They asked if in the top left side, next to battery power there was a icon of a half moon.  There was. They said to go in to settings and go to "Do not Disturb" and turn it off.  I did.....problem solved!!! Somehow "do not disturb" was turned on and that is what happens if it is!!
    I hope this helps.

Maybe you are looking for