Hibernate kill other applications who access to the DB
<p>i'm a student who creating a student project and i hava finished 99% of my works but the last percent dosent't want to works :).</p>

<p>I'm Calling a Java SE ServerSocket based application to start a thread and a few moment later, when I want convert a Video I'm sending the path of the video at the socket.</p>

<p>I have no mistake with this case but when i add all Hibernate features, i can't open N application because when I launch a new application (with a new different Socket), the new application kill the last one.</p>

<pre><code>    Worker worker = new Worker();
    worker.setSocket(Integer.parseInt(args[0]));
    worker.setAvailable(1);
    //DaoFactory.getWorkerDao().updateWorker(worker);

    try {
        ServerSocket server = new ServerSocket(Integer.parseInt(args[0]), 50);

        while(true){
            Socket socket = server.accept();
            ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
            String message = (String) ois.readObject();
            if(message.equalsIgnoreCase("STOP")) break;
            worker.setAvailable(0);
            //DaoFactory.getWorkerDao().updateWorker(worker);

            System.out.println("[CONVERT]: " + message);
            Convert.lanchConversion(message);

            ois.close();
            socket.close();
            worker.setAvailable(1);
            //DaoFactory.getWorkerDao().updateWorker(worker);
        }
        server.close();
        //DaoFactory.getWorkerDao().deleteWorker(Integer.parseInt(args[0]));
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

}
</code></pre>

<p>Do you have any idea why hibernate (when is uncommented) kill other applications ?</p>

<p>Thanks in advance.</p>

<p>PS: updateWorker close the EntityManagerFactory after edit the database.
PS2: Please apologize mms english, i'll do my best for this topic.</p>