Vector Replacement in Java 1.4 - Is Thread Safety Needed In This Scenario?

I have a Java 1.4 application that queries Database # 1, and builds custom strings used to create records that are inserted into Database # 2.
Right now Vectors are used as a container to temporarily hold query output from Database # 1 while building records going into Database # 2, but I want to convert away from this legacy collection type.
This application does this with a single "worker" thread that is started and monitored by the application main thread. If the main thread detects any exceptions, i.e. a network or any database problem, the application main thread will stop the single worker thread and restart a new single worker thread.
There are several instances of this application running simultaneously on the same server but accessing different test databases. When put into the production environment this application will run on a separate server and there will be only 1 instance of the application running.
I have reviewed numerous forums here and Google results and have not found much specific info that would closely apply to my exact design situation. I did not post any code since this is more of a design question than issue with a specific code snippet.
My question is: In the scenario I described, does thread safety need to be a factor in choosing a new collection type (to replace Vectors) and in building code that accesses this new collection type?

The several instances of the application are all independent JVMs and can't interact with each other directly at all. So there's no thread safety issue there and there never was. So what does that leave you? You've got a single worker thread using the Vector? There's no thread safety issue there either. The only time you have to think about thread safety is when two threads are trying to use the same object.

Similar Messages

  • Thread safety! Is this the right way?

    Hello,
    Lately I'm reading lot about thread-safety in Swing...
    so just wondering that is this the right way to code ...
    For ex following code executes(which makes DB connection and load some list) when user press the "connect (JButton)" ....
    private void prepareAndShowConnBox()
            //System.out.println("prep - EDT: " + javax.swing.SwingUtilities.isEventDispatchThread());
            pwd.setEchoChar('*');
            javax.swing.Box box1 = new javax.swing.Box(javax.swing.BoxLayout.Y_AXIS);
            javax.swing.Box box2 = new javax.swing.Box(javax.swing.BoxLayout.Y_AXIS);
            box1.add(new javax.swing.JLabel("DB URL :     "));
            box2.add(db_url);
            box1.add(new javax.swing.JLabel("User Name :  "));
            box2.add(uid);
            box1.add(new javax.swing.JLabel("Password :   "));
            box2.add(pwd);
            final javax.swing.Box box = new javax.swing.Box(javax.swing.BoxLayout.X_AXIS);
            box.add(box1);
            box.add(box2);
            int retval = javax.swing.JOptionPane.showOptionDialog(me, box,
                    "Database Connection:",
                    javax.swing.JOptionPane.OK_CANCEL_OPTION,
                    javax.swing.JOptionPane.QUESTION_MESSAGE,
                    null, null, null);
            if(retval == javax.swing.JOptionPane.OK_OPTION)
                status.setText("Connecting...");
                Thread t = new Thread(makeConn, "Conn Thread");
                t.setPriority(Thread.NORM_PRIORITY);
                t.start();
        }And the makeConn is....
    private Runnable makeConn = new Runnable()
            boolean success;
            Exception x;
            public void run()
                //System.out.println("Con - EDT: " + javax.swing.SwingUtilities.isEventDispatchThread());
                success = true;
                x = null;
                try
                    //load sun JDBC-ODBC bridgr driver...
                    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                    //make connection to DB...
                    con = java.sql.DriverManager.getConnection("jdbc:odbc:" + db_url.getText(),
                            uid.getText(), new String(pwd.getPassword()));
                catch(Exception e)
                    success = false;
                    x = e;
                    System.err.println(x);
                java.awt.EventQueue.invokeLater(GUItask);
            Runnable GUItask = new Runnable()
                public void run()
                    //System.out.println("Con gui - EDT: " + javax.swing.SwingUtilities.isEventDispatchThread());
                    if(success)
                        bConn.setText("Disconnect");
                        status.setText("");
                        status.setIcon(imgLink);
                        imgLink.setImageObserver(status);
                        //load the pic list...
                        Thread t = new Thread(execQuery, "List1 Thread");
                        t.setPriority(Thread.NORM_PRIORITY);
                        t.start();
                    else
                        status.setText("Connection Failed.");
                        showErr(x.toString());
        };Here uid,db_url (JTextField) , pwd (JPasswordField) , status (JLabel) are class fields.
    Thanks for any comments... :)

    Threading looks fine too me... the connection is created on a background thread, but (critically) all GUI updates are performed on the EDT, even if there's an exception. Well done.
    My only comment is... why is your GUI creating a database connection at all? Ideally the controler would get the DAO (which would connect itself) and inject it (the connected DAO) into the view... but I'm a server-side boy, so feel free to ignore me.
    Cheers. Keith.

  • Help in java program.i cnt solve the need of this question.question inside.

    Create a class named Employee. Includes data members for Employee class :
    Data member     = Data type
    Employee id     = String
    Employee name     = String
    Icno     = String
    Gender     = Char
    Date of birth     = String
    Address     = String
    Commencing Date     = String
    Department     = String
    Position     = String
    Salary     = Double
    Include any relevant methods for example constructor that can perform initialization for all data fields, accessor methods that return each of data field values and mutator method to set values into the data fields. Use a constructor to set each Employee id to 99999 upon object creation.
    Write another java application named EmployeeDb. Declare an array of three Employee objects.
    Your program should be able to perform the following functions:
    (a)     Prompt user to enter three Employees� information from the console and store data in an array
    (b)     Search an employee by name.
    (c)     Display all employee information by using a loop.
    You are NOT required to save records into any text file.
    the code i have done
    public class Employee
         //declaration of private instance variables
         private String employee_id;
         private String employee_name;
         private String ic_no;
         private char gender;
         private String date_of_birth;
         private String address;
         private String commencing_date;
         private String department;
         private String position;
         private double salary;
         /*constructor prototype
         Employee(String, String, String, char, String, String, String, String, String, double);
         //constructor - Employee(String, String, String, char, String, String, String, String, String, double); function
    public Employee()
         this.employee_id = "99999";
         this.employee_name = "name";
         this.ic_no = "ic";
         this.gender = 'g';
         this.date_of_birth = "dob";
         this.address = "add";
         this.commencing_date = "cd";
         this.department = "dept";
         this.position = "post";
         this.salary = 0.00;
    public Employee(String id, String name, String ic, char gen, String dob, String add, String cd, String dept, String post, double sal)
         this.employee_id = id;
         this.employee_name = name;
         this.ic_no = ic;
         this.gender = gen;
         this.date_of_birth = dob;
         this.address = add;
         this.commencing_date = cd;
         this.department = dept;
         this.position = post;
         this.salary = sal;
    /*public setters function prototypes
         public void setEmployee_id(String);
         public void setEmployee_name(String);
         public void setIc_no(String);
         public void setGender(char);
         public void setDate_of_birth(String);
         public void setAddress(String);
         public void setCommencing_date(String);
         public void setDepartment(String);
         public void setPosition(String);
         public void setSalary(double);
    public getters function prototypes
         public String getEmployee_id();
         public String getEmployee_name();
         public String getIc_no();
         public char getGender();
         public String getDate_of_birth();
         public String getAddress();
         public String getCommencing_date();
         public String getDepartment();
         public String getPosition();
         public double getSalary();
    //setters - setEmployee_id(String); function
    public void setEmployee_id(String id)
         this.employee_id = id;
    //setters - setEmployee_name(String); function
    public void setEmployee_name(String name)
         this.employee_name = name;
    //setters - setIc_no(String); function
    public void setIc_no(String ic)
         this.ic_no = ic;
    //setters - setGender(char); function
    public void setGender(char gen)
         this.gender = gen;
    //setters - setDate_of_birth(String); function
    public void setDate_of_birth(String dob)
         this.date_of_birth = dob;
    //setters - setAddress(String); function
    public void setAddress(String add)
         this.address = add;
    //setters - setCommencing_date(String); function
    public void setCommencing_date(String cd)
         this.commencing_date = cd;
    //setters - setDepartment(String); function
    public void setDepartment(String dept)
         this.department = dept;
    //setters - setPosition(String); function
    public void setPosition(String post)
         this.position = post;
    //setters - setSalary(double); function
    public void setSalary(double sal)
         this.salary = sal;
    //getters - getEmployee_id(); function
    public String getEmployee_id()
         return employee_id;
    //getters - getEmployee_name(); function
    public String getEmployee_name()
         return employee_name;
    //getters - getIc_no(); function
    public String getIc_no()
         return ic_no;
    //getters - getGender(); function
    public char getGender()
         return gender;
    //getters - getDate_of_birth(); function
    public String getDate_of_birth()
         return date_of_birth;
    //getters - getAddress(); function
    public String getAddress()
         return address;
    //getters - getCommencing_date(); function
    public String getCommencing_date()
         return commencing_date;
    //getters - getDepartment(); function
    public String getDepartment()
         return department;
    //getters - getPosition(); function
    public String getPosition()
         return position;
    //getters - getSalary(); function
    public double getSalary()
         return salary;
    //class ended
    import java.io.*;
    public class EmployeeDb
         //declaration of private instance variables
         private String employee_id;
         private String employee_name;
         private String ic_no;
         private char gender;
         private String date_of_birth;
         private String address;
         private String commencing_date;
         private String department;
         private String position;
         private double salary;
         public static void main(String args[]) throws IOException
              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
              int i;
              Employee [] empRec = new Employee[3] ;
              String [] emp = new String [10];
              for(i=0; i<empRec.length; i++)
                   empRec= new Employee();
                   System.out.print("\n");
                   i+=1;
                   System.out.print("employee record number "+ i +"\n");
                   System.out.print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
                   System.out.print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
                   System.out.print("\n");
                   System.out.print("Enter employee id : \n");
                   emp[0] = br.readLine();
                   System.out.print("Enter employee name : \n");
                   emp[1] = br.readLine();
                   System.out.print("Enter employee ic number : \n");
                   emp[2] = br.readLine();
                   System.out.print("Enter employee gender : \n");
                   emp[3] = br.readLine();
                   System.out.print("Enter employee date of birth : \n");
                   emp[4] = br.readLine();
                   System.out.print("Enter employee address : \n");
                   emp[5] = br.readLine();
                   System.out.print("Enter employee commencing date: \n");
                   emp[6] = br.readLine();
                   System.out.print("Enter employee department : \n");
                   emp[7] = br.readLine();
                   System.out.print("Enter employee position : \n");
                   emp[8] = br.readLine();
                   System.out.print("Enter employee salary : \n");
                   emp[9] = br.readLine();
              for(i=0; i<empRec.length; i++)
                   System.out.println(empRec[i].getEmployee_id());
                   System.out.println(empRec[i].getEmployee_name());
                   System.out.println(empRec[i].getIc_no());
                   System.out.println(empRec[i].getGender());
                   System.out.println(empRec[i].getDate_of_birth());
                   System.out.println(empRec[i].getAddress());
                   System.out.println(empRec[i].getCommencing_date());
                   System.out.println(empRec[i].getDepartment());
                   System.out.println(empRec[i].getPosition());
                   System.out.println(empRec[i].getSalary());

    42.
    On more consideration, maybe I'll expand that.
    When you post code; wrap it in tags to make it readable. Or highlight the code when you're posting and click that little button labeled CODE.
    We generally don't answer exam questions here, either.
    And please; make your post titles more legible than the rubbish you've given.
    Edited by: meacod on Feb 17, 2008 7:44 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • JNI communiction using a Java and a C++ Thread

    Hi,
    My purpose is to run a Java and a C++ thread parallel.
    The C++ thread receives events from a hardware. Getting an event it should put this (for testing it is just a String ) to a Java method (there the events will be collected in a vector).
    The Java thread should compute these vector step by step when it is scheduled.
    Therefore I have a Java Thread that invokes a native method.
    This C++ method
    1. stores a refernece to the JavaVM in a global var (using env->getJavaVM ),
    2. stores the object (given by JNICall) in a global var (reference to the calling java object),
    3. creates an object dynamically (this implements a Runnable C++ Interface needed for my Thread structure)
    4. and creates (dynamically) and starts a C++ Thread ( that uses the Win API ) giving it the former created object as parameter.
    Following the C++ thread uses the former stored global JavaVM to get a JNIEnv. It also uses the global stored object.
    After this I prepare for executing a callback to Java, e.g. AttachCurrentThread, GetObjectClass, GetMethodID and so on. Finally I sucessfully start some callbacks to Java (in the while loop of the thread).
    Now here is my Problem:
    The described way only works for a few calls and then raises an error. "java.exe hat ein Problem festgestellt und muss beendet werden." (german os) (In english it should be: "java.exe has detected a problem and has to be determined").
    What is wrong with my idea. It is something with the scope of my dynammically created objects? If have no idea anymore.
    Here the source code (C++ part):
    #include <jni.h>
    #include "benchmark.h"
    #include "bench.h"
    #include "canMessage.h"
    JavaVM *jvm;
    jobject javaObject;
    JNIEXPORT void JNICALL Java_Benchmark_startBench(JNIEnv *env, jobject obj, jobject obj2){
         env->GetJavaVM(&jvm);
         javaObject = obj2;
         cout << "\n C++ Starting benchmark\n\n";
         Benchmark *bm = new Benchmark();
         Thread *thread = new Thread(bm);
         thread->start();
         //thread->join(); //uncomment this there will be no error but also
                                         // no java thread doing it's job
    Benchmark::Benchmark(): _continue(false) {
    Benchmark::~Benchmark(){
    unsigned long Benchmark::run(){
         _continue = true;
         JNIEnv *jniEnv;
            jvm->AttachCurrentThread((void **)&jniEnv, NULL);
            jclass javaClass = jniEnv->GetObjectClass(javaObject);
         if(javaClass == NULL){
              cout << "--> Error: javaClass is null";
         jmethodID methodId = jniEnv->GetMethodID(javaClass, "addMessage", "(Ljava/lang/String;)V");
         if(methodId == NULL){
              cout << "--> Error: methodId is null";
         string str ("This is a test text.");
         const char *cStr = str.c_str();
         jstring javaString = jniEnv->NewStringUTF(cStr);
         jniEnv->CallVoidMethod(javaObject, methodId, javaString );
         int i_loopCount = 0;
         while(_continue){
              i_loopCount++;
              cout << i_loopCount << " C++ runing\n";
              jniEnv->MonitorEnter(javaObject);
              jniEnv->CallVoidMethod(javaObject, methodId, javaString );
              jniEnv->MonitorExit(javaObject);
              canMessage = new CANMessage();
              delete canMessage;
              canMessage = NULL;
         return 0;
    void Benchmark::stop(){
         _continue = false;
    }Is there a better and more elegant way to solve my problem?
    Thanks!

    At
    http://codeproject.com/cpp/OOJNIUse.asp
    http://www.simtel.net/product.php[id]93174[sekid]0[SiteID]simtel.net
    http://www.simtel.net/product.php[id]94368[sekid]0[SiteID]simtel.net
    you will find examples how to implement Java Interface in JNI C++ without Java coding.
    At
    http://www.simtel.net/product.php[id]95126[sekid]0[SiteID]simtel.net
    you can get pure JNI interface for DOTNET.

  • Thread Safety of Vector as Queue (Putting / Getting)

    i have a thread that is working on clearing a queue (a Vector).
    however, new items are being added to the queue intermittently.
    how should i do this properly?
    is the process below sufficient?
    Vectors are syncronized arent they?
    So using the methods below would it be safe if the Vector is
    having something removed as something is being added?
    public class QueueHandler extends Thread{
    public QueueHandler(){}
    public void run(){
    while(true){
    // if Queue.size() > 0 --> Handle Queue items
    // for(1 to size){ item = Queue.get(i); process(item)
    public void processItem(item){
    //do something
    // Queue.remove(item);
    public void addToQueue(item){
    Queue.add(item);
    Vector Queue;
    }

    import java.util.concurrent.*;
    public class QueueHandler extends Thread {
      public void run() {
        while(true) {
          processItem(queue.take());
      public void processItem(Object item) {
        //do something
      public void addToQueue(Object item) {
        queue.put(item);
      private BlockingQueue queue = new BlockingLinkedQueue();
    }

  • Type Error: oE Started immediately after Auto Java update! Other threads just started but doesn't mention the relationship! Firefox reset does not correct

    Problem correlates exactly with the Java update time per event viewer! Problem is starting to gain traction as more users experience same! Can’t determine how to fix? Maybe an error in the Java update?

    I have also been having this problem, starting today, although my Firefox doesn't crash/close when the error box pops up - I can just close the box and carry on browsing.
    However, as with the person in the thread listed above, I found that disabling McAfee SiteAdvisor seems to stop it happening (it happened fairly at random, but in about half an hour of browsing with it disabled, I haven't had the error pop up, compared to within a few minutes when SiteAdvisor is enabled). It looks like there was also a SiteAdvisor update today, so that also correlates with the onset of this problem. Are other people getting this problem using SiteAdvisor? I don't know much about the mechanics of SiteAdvisor - could there be a link with Java too?
    Using Firefox 27.0, Windows 7 SP1, McAfee SiteAdvisor 3.6.5, Java 10.45.2.18.

  • App crash when using JAVA callbacks from native threads in solaris

    Hi all,
    Sorry for putting the thread here. I did use the native methods forum, I wasnt lucky. I Hope more people would look into this forum, which brings me here.
    I have a solaris application which crashes when I try to callback the JAVA methods and variables from the native code. The description of the problem is below
    Written a native library, the library is multithreaded (i.e) I create a thread using pthread_create() in the native code which performs the operation of calling a JAVA method from the native code. The routine of calling the JAVA method works perfectly elsewhere outside the new thread.
    There are two scenarios I've tested it in
    1. I created a thread (say X) from the main thread (say Y) and made the y to wait until the X is complete using the pthread_join(). The JAVA callbacks works fine when called from Y but the app crashes if done from X.
    2. Did not make the Y to wait until the X is complete, hoping that both will run paralelly and even the the App crashes.
    And to be precise the Y is the thread where the native method is called from JAVA.
    I have tested for any memory leaks or stack corruption by removing the JAVA callbacks and bulding a executable and using purify, the report doesnot hint any such occurances.
    The linker options used for building the shared library is as follows
    ${GPP} ${INC} -G ${LIB} -mt -g -lCstd -lCrun -lpthread ${OBJS} -o <lib-name>
    I wonder if we can create threads in the native code when using JAVA callbacks and even if we can whether it would be appropiate to use the callbacks with in the threads
    Looking forward for any help.
    Regards,
    Vamsi

    Guys... can't any one help me with this problem :(

  • Java Bean Thread Safety

    I've been using JavaBeans for years now, and have read at least 30 different texts and online resources about using Java beans in JSPs. But in every single one of them, they are ambiguous and non-committal about how to properly use them to avoid Thread-Safety problems in a multithreaded (web server) environment. Are there any true Java gurus out there who know how to do so in JSPs?
    Specifically, when you use the <jsp:useBean> tag, that tag automatically binds an instance of your bean to the PageContext object. Since the PageContext object is shared by many threads, wouldn't this automatically make all of the Java Bean's properties vulnerable for thread problems? Since the pageContext is shared between threads, wouldnt one have to declare every one of the bean's setters and getters as "synchronized", to prevent one thread overwriting another's values?
    I ask because in many texts, they make a vague suggestion "be sure to write your beans thread-safe"--but provide no concrete answer as to how (the level at which to declare 'synchronized'). But in all their code examples, I have never once, in all these years, seen the word "synchronized".
    How is this possible? Wouldn't the bean, as bound to the thread-shared pageContext object, be completely exposed to thread corruption, with multiple threads simultaneously calling its methods?
    Can someone supply some code snippets showing the thread-safe way to use JavaBeans (i.e., where to synchronize)

    PageContext is shared by many threads?
    Not at one time, I'm pretty certain of that.
    From the API: A PageContext instance is obtained by a JSP implementation class by calling the JspFactory.getPageContext() method, and is released by calling JspFactory.releasePageContext().
    The to me suggests the contract that a PageContext can only be in use by on one JSP page at a time. As far as I am concerned, pageContext can be treated like a "local variable" to a jsp page.
    The contents of the pageContext object are maybe a different story, but we'll get to that.
    The things to worry about with thread safety are the same as they are for servlets.
    1 - Class attributes are not threadsafe. ie variables declared within <%! %> signs
    2 - Session attributes are potentially not threadsafe if the user makes two quick requests in a row (handling two requests for the same session)
    3 - Application attributes are never threadsafe as any currently running request can access them. Most Application level attributes I treat as read only (kinda like Singleton access)
    I don't see the need to go overboard declaring everything "synchronized". In fact I think it would be hugely detrimental.

  • Java.lang.IllegalMonitorStateException: current thread not owner

    Hello,
    my program runs an exe that doesn't return a zero when it's finished, therefore, I can't use a waitFor().
    To solve this problem i look at the length of the file which has to be manipulated by this exe every 200ms and see whether it's length stopped changing. This should mean it's job is done...
    But using this code:
    public void run(String filename)
              System.out.println("start runtime");
              Runtime rt = Runtime.getRuntime();
              String[] callAndArgs = { "lssvmFILE.exe", filename };
              try
                   Process child = rt.exec(callAndArgs);
                   child.wait(200);
                   filesize = 0;
                   while(filesize != file.length())                            {
                        filesize = file.length();
                        child.wait(200);
                   //child.waitFor();
                   System.out.println("Process exit code is:   " + child.exitValue());
              catch(IOException e)
              {     System.err.println( "IOException starting process!");}
              catch(InterruptedException e)
              {     System.err.println( "Interrupted waiting for process!");}
              System.out.println("end run");
         }i get this on my System.out:
    Exception occurred during event dispatching:
    java.lang.IllegalMonitorStateException: current thread not owner
            at java.lang.Object.wait(Native Method)
            at LssvmFile.run(LssvmFile.java:292)
            at LssvmFile.start(LssvmFile.java:189)
            at GUI.actionPerformed(GUI.java:137)
            at java.awt.Button.processActionEvent(Button.java:329)
            at java.awt.Button.processEvent(Button.java:302)
            at java.awt.Component.dispatchEventImpl(Component.java:2593)
            at java.awt.Component.dispatchEvent(Component.java:2497)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)

    Here's the code:
    I already found out that the sleep function indeed caused this exe to run so slow. It seems that everything stops when sleep is used. By setting the delay to 2ms the duration is satisfactory (some seconds).
    I also tried skipping the sleep and just using a while, but that ended in an endless loop. Setting the delay to 1ms lead to a stop when the filelength was 0 (i guess that was on the moment that the exe cleared the file and prepared to write) so it seems to me that 2ms is quite a good trade off.
    this part of the code is preceeded by writing the data to the file and afterwards the new data will be read in again...
         //Close the stream
              outFileStream.close();
         //Run lssvmFILE.exe to compute alpha & b
              long originalfilesize = file.length();
              run(filename);
              //wait untill job done
              Thread thread = new Thread();
              long filesize = file.length();
              try{thread.sleep(2);}
              catch(InterruptedException e){};
              while(filesize != file.length() || originalfilesize ==file.length())
                   filesize = file.length();
                   try{thread.sleep(2);}
                   catch(InterruptedException e){};
         //Set up Instream (read from file)
         //----------------------Bedankt!
    Bart

  • Will ABAP be completely Replace by JAVA

    Hi Friends,
    Will ABAP be replaced by JAVA in future.
    Or
    Will SAP give more importance to ABAP or JAVA
    If I set my  Business Programming in ABAP, Will it sound
    ever
    Please help in knowing the fact

    hi,
    ABAP can't die because its the easiest development tool . It can be easily seen that if you see development cost ABAP development can be completed in less time as compared to Java.  And SAP is not stopping ABAP but just given an option to develop in java. However it will be good for ABAP Developers to learn java. 
    ABAP is not a replacement for any thing and at the same time no other language is a replacement for ABAP.  FYI, ABAP is no more an ABAP/4. It is widely extended with the introduction of Web Application Server starting from release WAS 620. 
    In Object Oriented Paradigm ABAP is the only langauge that goes very near to all the properties of OOP concepts even comparted to JAVA and C++ starting from release WAS 630. You can developed and extend web applications using ABAP. It is much much more than what we see from R/2 and R/3 3.X releases...
    There is nothing to worry about it. Yes SAP is introducing J2EE platform as an alternate to make an implementation faster as in the market there are many JAVA developers compared to ABAP resources. 
    More than this, ABAP is the SAP proprietary language. Except R/3 kernel, every application/transaction including BASIS is written in ABAP. I don't think SAP is that foolish to replace ABAP with some thing else. Look at the development news in SAP AG official web site for more info. One might need to know Java and JSP for developing mySAP portals but starting from SAP NetWeaver (which is planned to be released officially by the next quarter this year) you can developed 
    heterogeneous portals using ABAP itself... 
    Hope the above clarifies how ABAP is moving a head in the programming era. 
    reward if helpful.
    regards,
    keerthi.

  • Java FX task daemon thread

    Hello,
    I'm working on a large scale GUI and running in to OOMs. Looking at the threads, there are hundreds of them sitting around named Java FX task daemon thread.
    Daemon Thread [Java FX task daemon thread] (Running)            
                                    Daemon Thread [Java FX task daemon thread] (Suspended)      
                                                    Unsafe.park(boolean, long) line: not available [native method]              
                                                    LockSupport.park(Object) line: 158        
                                                    AbstractQueuedSynchronizer$ConditionObject.await() line: 1987          
                                                    DelayQueue<E>.take() line: 160              
                                                    ScheduledThreadPoolExecutor$DelayedWorkQueue.take() line: 609   
                                                    ScheduledThreadPoolExecutor$DelayedWorkQueue.take() line: 602   
                                                    ScheduledThreadPoolExecutor(ThreadPoolExecutor).getTask() line: 947            
                                                    ThreadPoolExecutor$Worker.run() line: 907      
                                                    Thread.run() line: 662    Can anyone shed some light on what is starting these threads?

    I had similar issues with a server running on XP, where it kept dying randomly with no problems.
    I tracked down what was happening by getting the exit value of the java process - which may give you information regarding what happened to the process.
    For example, if CTRL+C was pressed you get a value of 130 returned in the Linux environment. Using this error information I found out why my server kept dying (which was the XP telnet window was sending dodgy key presses to the window the server was running in).
    The exit code of a process is available after it exits via $status in Unix or %errorlevel% in a PC .bat file.

  • Thread safety in Java Collaborations

    Is it necessary to write Java Collaborations in a thread safe manner? If so, under what scenario can a JCD become multithreaded?

    The implementation is a bit more complex then this. When you create a JCD that implements an existing web service (ie a JCD that is started by a connector), eDesigner will create a message driven bean that is triggered by the connector and a stateless session bean that will be called from the message driven bean. This stateless session bean will call your JCD web service method, the receive or the start method.
    Because your JCD is hosted in a stateless session bean it will receive all the benefits of the J2EE thread and instance management. If there are multiple JMS messages to process, the application server can create multiple instances of the stateless session bean that hosts your JCd and thereby multiple instances of your JCD class will be created. If these are no longer needed, the application server can destroy them. As stateless session beans are thread safe, you do not need to code your JCD's in a thread safe manner. Of course if you want to access static resources or use singletons then you will need to access these in a threda safe manner from the JCD.
    When you JCD's are started by a JMS message (this is when your JCD's implement the JMS receive web service), you can configure in the connectivity map how many instances of your JCD can be started concurrently by the application server. When double clicking the configuration block on the JMS inbound connection you can specify two options:
    - Connection Consumer or Serial mode: multiple instances can be started when multiple messages are available or not.
    - Server session pool size: how many instances can be created.

  • So how do vectors work in Java?

    One thing I really don't like about OOP and using people's code is I have no idea what detailed vector math operations are happening, so to save me hours of experimenting, I just assume Vector3D is being used:
    C = movevec.Magnitude
    // Affects only C variable, and gives me the length using sqrt(vectorX * VectorX + VectorY * VectorY)?
    C.normalize();
    // Affects all the X, Y, Z, components and divides them by the vector's magnitude?
    C = B.center.minus(A.center);
    // Is this the same thing as the one below and only affects C and not the X,Y,Z components?:
    C = B.center.distance(A.center);
    // Gives me another vector between object A's center, and object B's center?
    C = N.dot(C);
    // Gives me the cosine -1 to 1 between N and C?
    movevec.times(C);
    // C = C * C?
    I guess the one question that bugs me more is what is the difference between distance and minus? I speculate that distance returns an absolute value, and minus might be something completely different.

    I agree, only when docs are helpful, which in this case, doesn't help me since it's too vague.

  • I have recently purchased the latest ipad. Got to say I am extremely dissapointed that it does not support Java or Flash which are platforms needed to do online business banking. I am now faced with ditching it and replacing it with a competitors product

    I have recently purchased the latest ipad. Got to say I am extremely dissapointed that it does not support Java or flash which are platforms needed to do online business banking. I am now faced with ditching an expensive toy for a competitors product that offers full business functionallity. Is there any way round this ? It seems extremely bad form on apples part not to support this or make it very clear of the products limitations at the time of purchase.

    Well, my bank has an app but the website does not use Flash or Java.  While my credit union doesn't have an app, their website doesn't require Flash or Java either.
    I pay all my bills online, bank, and access my brokerage accounts.  None of the sites I have encountered require Flash or Java.  Some government sites do require Flash so I use Photon, it's a browser that does Flash content very well.  So you might check out some alternatives browsers.
    Otherwise I suppose you will either dump you bank, your iPad, or just not do online banking. 

  • What are the thread safety requirements for container implementation?

    I rarely see in the TopLink documentation reference to thread safety requirements and it’s not different for container implementation.
    The default TopLink implementation for:
    - List is Vector
    - Set is HashSet
    - Collection is Vector
    - Map is HashMap
    Half of them are thread safe implementations List/Collection and the other half is not thread safe Set/Map.
    So if I choose my own implementation do I need a thread safe implementation for?
    - List ?
    - Set ?
    - Collection ?
    - Map ?
    Our application is always reading and writing via UOW. So if TopLink synchronize update on client session objects we should be safe with not thread safe implementation for any type; does TopLink synchronize update on client session objects?
    The only thing we are certain is that it is not thread safe to read client session object or read read-only UOW object if they are ever expired or ever refreshed.
    We got stack dump below in an application always reading and writing objects from UOW, so we believe that TopLink doesn’t synchronize correctly when it’s updating the client session objects.
    java.util.ConcurrentModificationException
    at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:449)
    at java.util.AbstractList$Itr.next(AbstractList.java:420)
    at oracle.toplink.internal.queryframework.InterfaceContainerPolicy.next(InterfaceContainerPolicy.java:149)
    at oracle.toplink.internal.queryframework.ContainerPolicy.next(ContainerPolicy.java:460)
    at oracle.toplink.internal.helper.WriteLockManager.traverseRelatedLocks(WriteLockManager.java:140)
    at oracle.toplink.internal.helper.WriteLockManager.acquireLockAndRelatedLocks(WriteLockManager.java:116)
    at oracle.toplink.internal.helper.WriteLockManager.checkAndLockObject(WriteLockManager.java:349)
    at oracle.toplink.internal.helper.WriteLockManager.traverseRelatedLocks(WriteLockManager.java:144)
    at oracle.toplink.internal.helper.WriteLockManager.acquireLockAndRelatedLocks(WriteLockManager.java:116)
    at oracle.toplink.internal.helper.WriteLockManager.checkAndLockObject(WriteLockManager.java:349)
    at oracle.toplink.internal.helper.WriteLockManager.traverseRelatedLocks(WriteLockManager.java:144)
    at oracle.toplink.internal.helper.WriteLockManager.acquireLockAndRelatedLocks(WriteLockManager.java:116)
    at oracle.toplink.internal.helper.WriteLockManager.acquireLocksForClone(WriteLockManager.java:56)
    at oracle.toplink.publicinterface.UnitOfWork.cloneAndRegisterObject(UnitOfWork.java:756)
    at oracle.toplink.publicinterface.UnitOfWork.cloneAndRegisterObject(UnitOfWork.java:714)
    at oracle.toplink.internal.sessions.UnitOfWorkIdentityMapAccessor.getAndCloneCacheKeyFromParent(UnitOfWorkIdentityMapAccessor.java:153)
    at oracle.toplink.internal.sessions.UnitOfWorkIdentityMapAccessor.getFromIdentityMap(UnitOfWorkIdentityMapAccessor.java:99)
    at oracle.toplink.internal.sessions.IdentityMapAccessor.getFromIdentityMap(IdentityMapAccessor.java:265)
    at oracle.toplink.publicinterface.UnitOfWork.registerExistingObject(UnitOfWork.java:3543)
    at oracle.toplink.publicinterface.UnitOfWork.registerExistingObject(UnitOfWork.java:3503)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.registerIndividualResult(ObjectLevelReadQuery.java:1812)
    at oracle.toplink.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally(ObjectBuilder.java:455)
    at oracle.toplink.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:419)
    at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:379)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:455)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.conformIndividualResult(ObjectLevelReadQuery.java:622)
    at oracle.toplink.queryframework.ReadObjectQuery.conformResult(ReadObjectQuery.java:339)
    at oracle.toplink.queryframework.ReadObjectQuery.registerResultInUnitOfWork(ReadObjectQuery.java:604)
    at oracle.toplink.queryframework.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:421)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:811)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
    at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:388)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:836)
    at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2604)
    at oracle.toplink.publicinterface.Session.executeQuery(Session.java:993)
    at oracle.toplink.publicinterface.Session.executeQuery(Session.java:950)

    Hi Lionel,
    As a general rule of thumb, the ATI Rage 128 Pro will not support a 20" LCD. That being said, there are reports of it doing just that (possibly the edition that went into the cube).
    I'm not that familiar with the ins and outs of the Cube, so I can't give you authoritative information on it.
    A good place to start looking for answers is:
    http://cubeowner.com/kbase_2/
    Cheers!
    Karl

Maybe you are looking for

  • Text wrap not working properly CS4

    Despite trying numerous times over last few days, reviewing multiple tutorials to make sure I know what I'm doing, I simply cannot get the text wrap options to work properly. In SOME instances (not all ... why?!?) I can select text wrap, but when I t

  • BPM: Messages are not merged?

    Hello everybody, in BPM i have 1) one receive step 2) fork with 3 branches 2.1)BRANCH1 map received message -> response_1 2.2)BRANCH2 map received message -> response_2 2.3)BRANCH3 map received message -> response_3 3) fork ends 4) transformation wit

  • Generate bar codes in mail forms

    Hi, I know how to insert Bar codes in smartforms, but I need to print the bar codes in Mail Forms, is that possible? Thanks a lot, Nuno Moreira

  • Placing photos into templates

    Hi Trying to move my photos into the newsletter template, where the photo boxes are provided. However they seem to be too small for the photos. The end result being that alot of the photo gets cut off. I have tried resizing down to 800x600, cropping

  • Converting Web dynpro date to SAP date type

    Hi I am using BAPI_FLIGHT_GETLIST to get list of flights but depending on some input criteria eg. on a particular date. I have written code upto this: Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input(); wdContext.nodeBapi_Flight_Getlis