private void dropElement() throws Exception {
			Session s = HibernateUtil.getSessionFactory().getCurrentSession();
			try {
				ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
				Object obj = ois.readObject();
				
				if(obj instanceof NetworkHardware) {
					
					s.beginTransaction();
					s.delete(obj);
					s.getTransaction().commit();
					
					out.writeBytes(acceptCmd + "\n");
					toLog("Element deleted.");
				}
			} catch(ConstraintViolationException e) {
				out.writeBytes(failCmd + "\n");
				s.getTransaction().rollback();
			} catch(Exception e) {
				throw new Exception("Data transfer error." );
			}				
		}