Package org.hibernate

Examples of org.hibernate.Session.beginTransaction()


    } catch (final InterruptedException ex) {

      synchronized (getGUI().getSynchro()) {
        synchronized (getGUI().sync_tree) {
          final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
          session.beginTransaction();
          try {
            session.update(this); // pour le setDescription() => � enlever qd la description ne sera plus persistente

            getTarget().addEvent(new EventGenericProcess(false));
            // mettre un setstatus comme pour IPv4
View Full Code Here


    target_host_push.addSelectionListener(new SelectionListener() {
      public void widgetDefaultSelected(SelectionEvent e) {
        synchronized (synchro) {
          synchronized (sync_tree) {
            final Session session = synchro.getSessionFactory().getCurrentSession();
            session.beginTransaction();
            try  {
              final TargetIPv4 foo = new TargetIPv4("added by GUI",
                  GenericTools.stringToInet4Address(target_host_value.getText()), snmp_manager);
              if (addTargetAtCurrentPosition(foo) == true) foo.checkSNMPAwareness();
              target_host_value.setText("000.000.000.000");
View Full Code Here

            return;
          }
          synchronized (synchro) {
            synchronized (sync_tree) {
              final Session session = synchro.getSessionFactory().getCurrentSession();
              session.beginTransaction();
              try  {
                final TargetIPv6 foo = new TargetIPv6("added by GUI", address, snmp_manager);
                if (addTargetAtCurrentPosition(foo) == true) foo.checkSNMPAwareness();
                target_host6_value.setText("");
                session.getTransaction().commit();
View Full Code Here

        try {
          if (target_group_value.getText() != "")
            synchronized (synchro) {
              synchronized (sync_tree) {
                final Session session = synchro.getSessionFactory().getCurrentSession();
                session.beginTransaction();
                try {
                  addTargetAtCurrentPosition(new TargetGroup("added by GUI", target_group_value.getText()));
                  session.getTransaction().commit();
                } catch (Exception ex) {
                  session.getTransaction().rollback();
View Full Code Here

    // create initial objects only if they do not exist in the database
    synchronized (synchro) {
      synchronized (sync_tree) {
          final Session session = synchro.getSessionFactory().getCurrentSession();
          try {
            session.beginTransaction();
          } catch (final org.hibernate.exception.JDBCConnectionException ex) {
            // c'est ici que �a se termine quand on ouvre deux fois sur la m�me database maintenue par un fichier par HSQLDB
            final MessageBox dialog = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
            // � traduire
            dialog.setText("GNetWatch Fatal Error");
View Full Code Here

          if (System.currentTimeMillis() - last_time > 1000) {

          synchronized (getGUI().getSynchro()) {
            synchronized (getGUI().sync_tree) {
              final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
              session.beginTransaction();
              try {
                session.update(this);

                getTarget().addEvent(new EventFlood(new Double(((double) 8 * 1000 * bytes_sent) / (System.currentTimeMillis() - last_time)).intValue()));

View Full Code Here

    asyncExec(new Runnable() {
      public void run() {
        synchronized (synchro) {
          final Session session = synchro.getSessionFactory().getCurrentSession();
          session.beginTransaction();

          try {
            final XMLConfiguration initial = new XMLConfiguration(filename);
            initial.setExpressionEngine(new XPathExpressionEngine());
View Full Code Here

            setImageHost6SNMP();

            if (event != null && event.getResponse() != null && event.getResponse().size() > 0 &&
                event.getResponse().get(0) != null && event.getResponse().get(0).getVariable() != null) {
              final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
              session.beginTransaction();
              try {
              session.update(_this);
              setType(event.getResponse().get(0).getVariable().toString());
              session.getTransaction().commit();
              } catch (final Exception ex) {
View Full Code Here

            synchronized (gui.getSynchro()) {
              synchronized (gui.sync_tree) {
                if (gui.containsCanonicalInstance(foo)) return;

                final Session session = gui.getSynchro().getSessionFactory().getCurrentSession();
                session.beginTransaction();
                // � revoir
                try {
                  if (foo.addTarget(gui, (Target) null) == true) {
                    session.getTransaction().commit();
                    gui.setStatus(gui.getConfig().getPattern("adding_target", foo.getAddress().toString().substring(1)));
View Full Code Here

            setImageHostSNMP();

            if (event != null && event.getResponse() != null && event.getResponse().size() > 0 &&
                event.getResponse().get(0) != null && event.getResponse().get(0).getVariable() != null) {
              final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
              session.beginTransaction();
              try {
              session.update(_this);
              setType(event.getResponse().get(0).getVariable().toString());
              session.getTransaction().commit();
              } catch (final Exception ex) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.