Package org.hibernate

Examples of org.hibernate.Session.beginTransaction()


            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


        }

        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
              if (value_ok) {
                getTarget().addEvent(new EventGenericSrc(true, value, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10, units));
                getGUI().setStatus(getGUI().getConfig().getPattern("new_file_value", GenericTools.formatNumericString(getGUI().getConfig(), new Integer(value < 0 ? value1 : value).toString())));
View Full Code Here

    } 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 EventGenericSrc(false));
            // mettre un setstatus comme pour IPv4
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 EventHTTP(new Double(((double) 8 * 1000 * bytes_received) /
                      (System.currentTimeMillis() - last_time)).intValue()));
View Full Code Here

      if (querier.isSNMPCapable()) getTarget().setImageHostSNMP();

      synchronized (getGUI().getSynchro()) {
        synchronized (getGUI().sync_tree) {
          final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
          session.beginTransaction();
          try {
            for (final TableEvent table_event : interfaces) {
              try {
                if (table_event == null || table_event.getColumns() == null || table_event.getColumns().length < 2 ||
                    table_event.getColumns()[0] == null || table_event.getColumns()[0].getVariable() == null ||
View Full Code Here

                          synchronized (getGUI().sync_tree) {

                            if (getGUI().containsCanonicalInstance(foo)) return;

                            final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
                            session.beginTransaction();
                            try {

                              foo.addTarget(getGUI(), getTarget());
                              targets.put(new Integer(table_event.getColumns()[0].getVariable().toString()),
                                  (TargetInterface) getGUI().getCanonicalInstance(foo));
View Full Code Here

    final java.util.List<TableEvent> interfaces = querier.getInterfaces();

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

          for (final TableEvent table_event : interfaces) { // bug : en sortant de gnetwatch, une modification concurrente est apparue sur interfaces => � prot�ger par un verrou
            if (table_event == null || table_event.getColumns() == null || table_event.getColumns().length == 0 ||
                table_event.getColumns()[0] == null || table_event.getColumns()[0].getVariable() == null) continue;
View Full Code Here

  public void refreshDataViews(final Target target, final Class event_type) throws Exception {
    synchronized (gui.getSynchro()) {
      // blocage ici
      synchronized (gui.sync_tree) {
        final Session session = gui.getSynchro().getSessionFactory().getCurrentSession();
        session.beginTransaction();
        try  {
          if (event_type == EventGeneric.class) {
            // nothing to do : no view can handle generic events
          }
View Full Code Here

        getParents().get(0).setType(match.group(2));

      synchronized (getGUI().getSynchro()) {
        synchronized (getGUI().sync_tree) {
          final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
          session.beginTransaction();
          try {
            getTarget().addEvent(new EventNmap(cmd_output));
            session.getTransaction().commit();
          } catch (final Exception ex) {
            log.error("Exception", ex);
View Full Code Here

      getGUI().asyncExec(new Runnable() {
        public void run() {
          synchronized (getGUI().getSynchro()) {
            synchronized (getGUI().sync_tree) {
              final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
              session.beginTransaction();
              try  {
                if (getParents() != null && getParents().size() > 0 && getParents().get(0) != null)
                  removeVisualElements(getParents().get(0));
                else log.error("no parent!");
                session.getTransaction().commit();
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.