9 Replies Latest reply on Mar 20, 2009 10:01 AM by Imanol Studer

    EntityManager, concurrency, long running methods

    Imanol Studer Newbie
      good evening,
      I'm stuck with the following problem:
      I've got a Stateless Session Bean with 5 Methods. 4 of those Methods are using an entity manager and need a new Transaction before calling -TransactionAttribute(REQUIRES_NEW)-. The thing is, that a method call can take up to a few hours. concurrent calls must be possible. At the Moment it works without exceptions, but the problem is that the entitymanager/queries seems to serialize the actions (merge, persist, query.getResultList() etc.). these actions often block each other. when i'm already running a method, and a second call comes in for the same or another method, the second call stands still on the first query.getResultList() or whatever statement. the 5 public methods are called in a row according to their order.

      is there a way to disable this serialization mechanism of the entitymanager just for this bean? the threads aren't working with the same data, so the bean will be threadsafe.

      thanks in advance
        • 1. Re: EntityManager, concurrency, long running methods
          Imanol Studer Newbie

          here's the code:


          package ch.sedd.osiris.datareaders.memograph;
          
          import java.io.IOException;
          import java.util.ArrayList;
          import java.util.Calendar;
          import java.util.Date;
          import java.util.GregorianCalendar;
          import java.util.HashMap;
          import java.util.List;
          import java.util.Map;
          import java.util.Random;
          import java.util.Map.Entry;
          
          import javax.ejb.Stateless;
          import javax.ejb.TransactionAttribute;
          import javax.ejb.TransactionAttributeType;
          import javax.persistence.EntityManager;
          import javax.persistence.PersistenceContext;
          import javax.persistence.Query;
          
          import org.jboss.seam.ScopeType;
          import org.jboss.seam.annotations.In;
          import org.jboss.seam.annotations.Logger;
          import org.jboss.seam.annotations.Name;
          import org.jboss.seam.annotations.Scope;
          import org.jboss.seam.log.Log;
          
          import ch.sedd.osiris.entity.DBFile;
          import ch.sedd.osiris.entity.DataSource;
          import ch.sedd.osiris.entity.DataSourceChannel;
          import ch.sedd.osiris.entity.MeasuringParameter;
          import ch.sedd.osiris.entity.MeasuringValue;
          import ch.sedd.osiris.entity.MeasuringValueCalculation;
          import ch.sedd.osiris.entity.MeasuringValueStep;
          import ch.sedd.osiris.entity.MemographConfiguration;
          import ch.sedd.osiris.entity.MemographData;
          import ch.sedd.osiris.session.seam.CurrentValuesManager;
          import ch.sedd.osiris.util.BatchProcessingCounter;
          import ch.sedd.osiris.util.MeasuringParameterLiveInfo;
          import ch.sedd.osiris.util.MeasuringValueItem;
          import ch.sedd.osiris.util.TimeInterval;
          
          @Stateless
          @Scope(ScopeType.STATELESS)
          @Name("memographAdapter")
          public class MemographAdapterBean implements MemographAdapter {
                  @PersistenceContext
                  EntityManager entityManager;
          
                  private int rand = new Random().nextInt();
          
                  @In(value = "#{currentValuesManager}")
                  private CurrentValuesManager currentValuesManager;
          
                  @Logger
                  private Log logger;
          
                  private MemographConfigurationParser mcParser = new MemographConfigurationParser();
                  private MemographDataParser mdParser = new MemographDataParser();
          
                  private MemographConfigurationBlock getCurrentMemographConfiguration(
                                  DataSource dataSource) throws Exception {
                          Query q = entityManager
                                          .createQuery("select max(mc.code) as code from MemographConfiguration mc where mc.dataSource.id=:dataSourceId");
                          q.setParameter("dataSourceId", dataSource.getId());
                          Integer code = (Integer) q.getSingleResult();
                          q = entityManager
                                          .createQuery("select mc from MemographConfiguration mc where mc.code=:code and mc.dataSource.id=:dataSourceId");
                          q.setParameter("code", code);
                          q.setParameter("dataSourceId", dataSource.getId());
                          MemographConfiguration mc = (MemographConfiguration) q
                                          .getSingleResult();
                          MemographConfigurationBlock mcb = mcParser.readConfiguration(mc
                                          .getFile().getContent());
                          mcb.setId(mc.getCode());
                          return mcb;
                  }
          
                  @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                  public void updateMemographConfigurations(DataSource dataSource)
                                  throws Exception {
                          logger.info("[{0}] [bean {1}] updating memograph configurations...",
                                          dataSource.getName(), rand);
          
                          MemographDriver memographDriver = MemographAdapterProperties
                                          .getProperties(dataSource).getMemographDriver();
          
                          int maxConfig = memographDriver.getCurrentConfigurationId();
          
                          Query q = entityManager
                                          .createQuery("select max(mc.code) from MemographConfiguration mc where mc.dataSource.id=:dataSourceId");
                          q.setParameter("dataSourceId", dataSource.getId());
                          int maxAvailable = -1;
                          try {
                                  maxAvailable = (Integer) q.getSingleResult();
                          } catch (NullPointerException e) {
                          }
          
                          logger.info("[{0}] max code getted", dataSource.getName());
          
                          if (maxAvailable < maxConfig) {
                                  logger.info("[{0}] looping through configs...", dataSource
                                                  .getName());
                                  for (int i = maxAvailable + 1; i <= maxConfig; i++) {
                                          logger.info("[{0}] getting config...", dataSource.getName());
                                          byte[] mcRaw = memographDriver.readConfiguration(i);
                                          MemographConfigurationBlock mcb = mcParser
                                                          .readConfiguration(mcRaw);
                                          DBFile dbFile = new DBFile();
                                          dbFile.setContent(mcRaw);
                                          dbFile.setSize(mcRaw.length);
                                          List<DataSourceChannel> dscs = new ArrayList<DataSourceChannel>();
                                          for (MemographChannel channel : mcb.getChannelsOrdered()) {
                                                  q = entityManager
                                                                  .createQuery("select dsc from DataSource ds inner join ds.dataSourceChannels dsc where ds.id=:dataSourceId and dsc.channel=:channel");
                                                  q.setParameter("dataSourceId", dataSource.getId());
                                                  q.setParameter("channel", channel.getName());
                                                  List<DataSourceChannel> dataSourceChannels = q
                                                                  .getResultList();
                                                  if (dataSourceChannels.size() == 1) {
                                                          dscs.add(dataSourceChannels.get(0));
                                                  }
                                          }
                                          MemographConfiguration mc = new MemographConfiguration();
                                          mc.setCode(i);
                                          mc.setDataSource(dataSource);
                                          mc.setFile(dbFile);
                                          entityManager.persist(dbFile);
                                          entityManager.persist(mc);
                                          logger
                                                          .info("[{0}] getted and persisted!", dataSource
                                                                          .getName());
                                  }
                          }
          
                          logger.info("[{0}] saving...", dataSource.getName());
                  }
          
          

          • 2. Re: EntityManager, concurrency, long running methods
            Imanol Studer Newbie
                    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                    public void updateMemographDatas(DataSource dataSource) throws Exception {
                            logger.info("[{0}] updating memograph datas...", dataSource.getName());
            
                            MemographDriver memographDriver = MemographAdapterProperties
                                            .getProperties(dataSource).getMemographDriver();
                            Query q = entityManager
                                            .createQuery("select count(md) from MemographData md where md.memographConfiguration.dataSource.id=:dataSourceId");
                            q.setParameter("dataSourceId", dataSource.getId());
                            Long memographDatas = (Long) q.getSingleResult();
                            logger.info("[{0}] mds getted", dataSource.getName());
                            byte[] rawData = null;
                            if (memographDatas > 0) {
                                    rawData = memographDriver.restoreFromPointer();
                            } else {
                                    rawData = memographDriver.restoreAll();
                            }
            
                            logger.info("[{0}] md blocks read", dataSource.getName());
            
                            Map<byte[], MemographDataBlockInfo> mdbis = mdParser
                                            .generateMemographDataBlockInfos(rawData);
            
                            BatchProcessingCounter c = new BatchProcessingCounter();
                            logger.info("[{0}] looping through mds...", dataSource.getName());
                            for (Entry<byte[], MemographDataBlockInfo> mdbi : mdbis.entrySet()) {
                                    logger.info("[{0}] saving md...", dataSource.getName());
                                    q = entityManager
                                                    .createQuery("select mc from MemographConfiguration mc where mc.dataSource.id=:dataSourceId and mc.code=:code");
                                    q.setParameter("dataSourceId", dataSource.getId());
                                    q.setParameter("code", mdbi.getValue().getConfigId());
                                    MemographConfiguration mc = (MemographConfiguration) q
                                                    .getSingleResult();
            
                                    q = entityManager
                                                    .createQuery("delete from MemographData md where md.memographConfiguration.id=:memographConfigurationId and md.start=:start and md.end<=:end");
                                    q.setParameter("start", mdbi.getValue().getStart());
                                    q.setParameter("end", mdbi.getValue().getEnd());
                                    q.setParameter("memographConfigurationId", mc.getId());
                                    q.executeUpdate();
            
                                    DBFile dbFile = new DBFile();
                                    dbFile.setContent(mdbi.getKey());
                                    dbFile.setSize(mdbi.getKey().length);
            
                                    MemographData md = new MemographData();
                                    md.setStart(mdbi.getValue().getStart());
                                    md.setEnd(mdbi.getValue().getEnd());
                                    md.setMemographConfiguration(mc);
                                    md.setFile(dbFile);
                                    entityManager.persist(md);
            
                                    if (c.increment()) {
                                            entityManager.flush();
                                            entityManager.clear();
                                    }
                                    logger.info("[{0}] done!", dataSource.getName());
                            }
                            logger.info("[{0}] saving...", dataSource.getName());
                    }
            
                    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                    public void updateMeasuringParametersFromArchive(
                                    Map<MeasuringParameter, TimeInterval> outOfDate,
                                    Date firstOutOfDate, Date lastOutOfDate, DataSource dataSource)
                                    throws Exception {
                            logger.info("[{0}] updating measuring values...", dataSource.getName());
            
                            Map<DataSourceChannel, Date> lastReadDates = new HashMap<DataSourceChannel, Date>();
            
                            for (MeasuringParameter measuringParameter : outOfDate.keySet()) {
                                    Query q = entityManager
                                                    .createQuery("delete from MeasuringValue mv where mv.measuringParameter.id=:measuringParameterId and mv.measuringValueStep.id>:measuringValueStepId and mv.date>=:start and mv.date<=:end");
                                    q.setParameter("measuringParameterId", measuringParameter.getId());
                                    q.setParameter("start", firstOutOfDate);
                                    q.setParameter("end", lastOutOfDate);
                                    q.setParameter("measuringValueStepId", 1);
                                    q.executeUpdate();
                                    logger.info("[{0}] old deleted", dataSource.getName());
                            }
            
                            Map<byte[], MemographConfigurationBlock> mcbs = new HashMap<byte[], MemographConfigurationBlock>();
            
                            List<MemographData> mds = null;
            
                            if (firstOutOfDate != null) {
                                    Query q = entityManager
                                                    .createQuery("select md from MemographData md where "
                                                                    + "md.memographConfiguration.dataSource.id=:dataSourceId and "
                                                                    + "((md.start between :start and :end) or "
                                                                    + "(md.end between :start and :end) or "
                                                                    + "(md.start<=:start and md.end>=:end)) "
                                                                    + "order by md.end asc");
                                    q.setParameter("start", firstOutOfDate);
                                    q.setParameter("end", lastOutOfDate);
                                    q.setParameter("dataSourceId", dataSource.getId());
                                    mds = q.getResultList();
                                    logger.info("[{0}] mds getted", dataSource.getName());
                            } else {
                                    Query q = entityManager
                                                    .createQuery("select md from MemographData md where "
                                                                    + "md.memographConfiguration.dataSource.id=:dataSourceId and "
                                                                    + "md.start<=:end order by md.end asc");
                                    q.setParameter("end", lastOutOfDate);
                                    q.setParameter("dataSourceId", dataSource.getId());
            
                                    mds = q.getResultList();
                                    logger.info("[{0}] mds getted", dataSource.getName());
                            }
            
                            try {
                                    for (MemographData md : mds) {
                                            MemographConfigurationBlock mcBlock;
                                            mcBlock = mcParser.readConfiguration(md
                                                            .getMemographConfiguration().getFile().getContent());
                                            mcBlock.setId(md.getMemographConfiguration().getCode());
                                            mcbs.put(md.getFile().getContent(), mcBlock);
                                    }
                            } catch (IOException e) {
                                    e.printStackTrace();
                            }
            
                            logger.info("[{0}] mds parsed", dataSource.getName());
            
                            Query q = entityManager
                                            .createQuery("select dsc from DataSource ds inner join ds.dataSourceChannels dsc where ds.id=:dataSourceId");
                            q.setParameter("dataSourceId", dataSource.getId());
                            List<DataSourceChannel> dscs = q.getResultList();
                            logger.info("[{0}] dscs getted", dataSource.getName());
            
                            Map<String, MeasuringParameter> channelParameter = new HashMap<String, MeasuringParameter>();
                            Map<MeasuringParameter, DataSourceChannel> pDsc = new HashMap<MeasuringParameter, DataSourceChannel>();
            
                            for (DataSourceChannel dsc : dscs) {
                                    if (dsc.getMeasuringParameter() != null) {
                                            channelParameter.put(dsc.getChannel(), dsc
                                                            .getMeasuringParameter());
                                            pDsc.put(dsc.getMeasuringParameter(), dsc);
                                    }
                            }
            
                            BatchProcessingCounter c = new BatchProcessingCounter();
                            List<MemographDataBlock> mdbs = mdParser.generateMemographData(mcbs);
            
                            logger.info("[{0}] looping through mds..", dataSource.getName());
                            for (MemographDataBlock mdb : mdbs) {
                                    Calendar cal = GregorianCalendar.getInstance();
                                    cal.setTime(mdb.getMemographDataBlockInfo().getEnd());
            
                                    for (Entry<MemographChannel, List<MeasuringValueItem>> entry : mdb
                                                    .getMeasuringValues().entrySet()) {
                                            MemographChannel mc = entry.getKey();
                                            MeasuringParameter mp = channelParameter.get(mc.getName());
                                            if (mp != null) {
                                                    for (MeasuringValueItem mvi : entry.getValue()) {
                                                            if ((outOfDate.get(mp).getStart() == null
                                                                            || mvi.getDate().after(
                                                                                            outOfDate.get(mp).getStart()) || mvi
                                                                            .getDate().equals(outOfDate.get(mp).getStart()))
                                                                            && (mvi.getDate().before(
                                                                                            outOfDate.get(mp).getEnd()) || mvi
                                                                                            .getDate().equals(
                                                                                                            outOfDate.get(mp).getEnd()))) {
            
                                                                    if (!lastReadDates.containsKey(mp)
                                                                                    || lastReadDates.get(mp).getTime() < mvi
                                                                                                    .getDate().getTime()) {
                                                                            lastReadDates.put(pDsc.get(mp), mvi.getDate());
                                                                    }
            
                                                                    MeasuringValue mv = new MeasuringValue();
                                                                    mv.setDate(mvi.getDate());
                                                                    mv.setMeasuringParameter(mp);
                                                                    mv.setMeasuringValueCalculation(entityManager.find(
                                                                                    MeasuringValueCalculation.class, 1));
                                                                    mv.setMeasuringValueStep(entityManager.find(
                                                                                    MeasuringValueStep.class, 1));
                                                                    mv.setValue(mvi.getValue());
                                                                    entityManager.persist(mv);
            
                                                                    if (c.increment()) {
                                                                            entityManager.flush();
                                                                            entityManager.clear();
                                                                    }
                                                            }
                                                    }
                                            }
                                    }
                            }
            
                            logger.info("[{0}] setting last read date...", dataSource.getName());
                            for (Entry<DataSourceChannel, Date> lastReadDate : lastReadDates
                                            .entrySet()) {
                                    DataSourceChannel dsc = lastReadDate.getKey();
            
                                    if (dsc.getMeasuringParameter() != null
                                                    && dsc.getLastRead() == null
                                                    || dsc.getLastRead().before(lastReadDate.getValue())) {
                                            dsc.setLastRead(lastReadDate.getValue());
                                            entityManager.persist(entityManager.merge(dsc));
                                    }
                            }
            
                            logger.info("[{0}] saving...", dataSource.getName());
                    }
            
                    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                    public void updateStatistics(
                                    Map<MeasuringParameter, TimeInterval> outOfDate,
                                    DataSource dataSource) {
                            logger.info("[{0}] updating measuring statistics...", dataSource
                                            .getName());
                            for (Entry<MeasuringParameter, TimeInterval> measuringParameterInterval : outOfDate
                                            .entrySet()) {
                                    TimeInterval interval = measuringParameterInterval.getValue();
                                    MeasuringParameter measuringParameter = measuringParameterInterval
                                                    .getKey();
            
                                    Date start = interval.getStart();
                                    Date end = interval.getEnd();
            
                                    if (start == null) {
                                            Query query = entityManager
                                                            .createQuery("select max(mv.date) from MeasuringValue mv where "
                                                                            + "mv.measuringParameter.id=:measuringParameterId and "
                                                                            + "mv.measuringValueStep.id!=1");
                                            query.setParameter("measuringParameterId", measuringParameter
                                                            .getId());
                                            start = (Date) query.getSingleResult();
                                            if (start == null) {
                                                    query = entityManager
                                                                    .createQuery("select min(mv.date) from MeasuringValue mv where "
                                                                                    + "mv.measuringParameter.id=:measuringParameterId ");
                                                    query.setParameter("measuringParameterId",
                                                                    measuringParameter.getId());
                                                    start = (Date) query.getSingleResult();
                                                    if (start == null)
                                                            return;
                                            }
                                    }
                                    if (end == null) {
                                            Query query = entityManager
                                                            .createQuery("select max(mv.date) from MeasuringValue mv where "
                                                                            + "mv.measuringParameter.id=:measuringParameterId and "
                                                                            + "mv.measuringValueStep=1");
                                            query.setParameter("measuringParameterId", measuringParameter
                                                            .getId());
                                            end = (Date) query.getSingleResult();
                                    }
            
                                    Calendar periodStart = GregorianCalendar.getInstance();
                                    Calendar periodEnd = GregorianCalendar.getInstance();
            
                                    int dayStartHour = 0;
                                    int dayStartMinute = 0;
            
                                    Query query = null;
            
                                    MeasuringValueCalculation measuringValueAverageCalculation = entityManager
                                                    .find(MeasuringValueCalculation.class, 1);
                                    MeasuringValueCalculation measuringValueSumCalculation = entityManager
                                                    .find(MeasuringValueCalculation.class, 2);
            
                                    MeasuringValueStep measuringValueStep = entityManager.find(
                                                    MeasuringValueStep.class, 2);
            
                                    BatchProcessingCounter c = new BatchProcessingCounter();
            
                                    // logger.info("[{0}] {1}: calculating hours stats...",
                                    // dataSource.getName(), measuringParameter.getName());
                                    //
                                    // // Hours Statistics
                                    // periodStart.setTime(start);
                                    // periodStart.set(Calendar.MINUTE, 0);
                                    // periodStart.set(Calendar.SECOND, 0);
                                    // periodStart.set(Calendar.MILLISECOND, 0);
                                    // periodEnd.setTime(periodStart.getTime());
                                    // periodEnd.add(Calendar.HOUR_OF_DAY, 1);
                                    //
                                    //
                                    // query = em
                                    // .createQuery("delete from MeasuringValue where "
                                    // + "measuringParameter.id=:measuringParameterId and "
                                    // + "measuringValueStep.id=:measuringValueStepId and "
                                    // +
                                    // "(measuringValueCalculation.id=:measuringValueAverageCalculationId or "
                                    // +
                                    // "measuringValueCalculation.id=:measuringValueSumCalculationId) and "
                                    // + "date between :startDate and :endDate");
                                    // query.setParameter("measuringParameterId", measuringParameter
                                    // .getId());
                                    // query.setParameter("startDate", periodStart.getTime());
                                    // query.setParameter("endDate", end);
                                    // query.setParameter("measuringValueAverageCalculationId",
                                    // measuringValueAverageCalculation.getId());
                                    // query.setParameter("measuringValueSumCalculationId",
                                    // measuringValueSumCalculation.getId());
                                    // query.setParameter("measuringValueStepId", measuringValueStep
                                    // .getId());
                                    // query.executeUpdate();
                                    //                      
                                    //                      
                                    // while (periodEnd.getTime().before(end)
                                    // || periodEnd.getTime().equals(end)) {
                                    // // Average
                                    // query = em
                                    // .createQuery("select avg(mv.value) from MeasuringValue mv where "
                                    // + "mv.measuringParameter.id=:measuringParameterId and "
                                    // +
                                    // "mv.date between :startDate and :endDate and measuringValueStep=1 "
                                    // + "and measuringValueCalculation=1");
                                    // query.setParameter("measuringParameterId", measuringParameter
                                    // .getId());
                                    // query.setParameter("startDate", periodStart.getTime());
                                    // query.setParameter("endDate", periodEnd.getTime());
                                    // Double avg = (Double) query.getSingleResult();
                                    // MeasuringValue mv = new MeasuringValue();
                                    // mv.setDate(periodStart.getTime());
                                    // mv.setValue(avg);
                                    // mv.setMeasuringParameter(measuringParameter);
                                    // mv
                                    // .setMeasuringValueCalculation(measuringValueAverageCalculation);
                                    // mv.setMeasuringValueStep(measuringValueStep);
                                    // em.persist(mv);
                                    //
                                    // if (c.increment()) {
                                    // em.flush();
                                    // em.clear();
                                    // }
                                    //
                                    // // Sum
                                    // query = em
                                    // .createQuery("select sum(mv.value) from MeasuringValue mv where 
            

            • 3. Re: EntityManager, concurrency, long running methods
              Imanol Studer Newbie
              
                                      // + "mv.measuringParameter.id=:measuringParameterId and "
                                      // +
                                      // "mv.date between :startDate and :endDate and measuringValueStep=1 "
                                      // + "and measuringValueCalculation=1");
                                      // query.setParameter("measuringParameterId", measuringParameter
                                      // .getId());
                                      // query.setParameter("startDate", periodStart.getTime());
                                      // query.setParameter("endDate", periodEnd.getTime());
                                      // Double sum = (Double) query.getSingleResult();
                                      // mv = new MeasuringValue();
                                      // mv.setDate(periodStart.getTime());
                                      // mv.setValue(sum);
                                      // mv.setMeasuringParameter(measuringParameter);
                                      // mv.setMeasuringValueCalculation(measuringValueSumCalculation);
                                      // mv.setMeasuringValueStep(measuringValueStep);
                                      // em.persist(mv);
                                      //
                                      // if (c.increment()) {
                                      // em.flush();
                                      // em.clear();
                                      // }
                                      //
                                      // periodStart.add(Calendar.HOUR_OF_DAY, 1);
                                      // periodEnd.add(Calendar.HOUR_OF_DAY, 1);
                                      // }
                                      // logger.info("[{0}] {1}: calculating hours stats done!",
                                      // dataSource.getName(), measuringParameter.getName());
              
                                      // Days Statistics
                                      periodStart.setTime(start);
              
                                      Calendar dayStart = GregorianCalendar.getInstance();
                                      dayStart.setTime(start);
                                      dayStart.set(Calendar.HOUR_OF_DAY, dayStartHour);
                                      dayStart.set(Calendar.MINUTE, dayStartMinute);
              
                                      if (periodStart.before(dayStart)) {
                                              periodStart.add(Calendar.DATE, -1);
                                      }
              
                                      periodStart.set(Calendar.HOUR_OF_DAY, dayStartHour);
                                      periodStart.set(Calendar.MINUTE, dayStartMinute);
              
                                      periodStart.set(Calendar.MINUTE, 0);
                                      periodStart.set(Calendar.SECOND, 0);
                                      periodStart.set(Calendar.MILLISECOND, 0);
              
                                      periodEnd.setTime(periodStart.getTime());
                                      periodEnd.add(Calendar.DATE, 1);
              
                                      measuringValueStep = entityManager
                                                      .find(MeasuringValueStep.class, 3);
              
                                      query = entityManager
                                                      .createQuery("delete from MeasuringValue where "
                                                                      + "measuringParameter.id=:measuringParameterId and "
                                                                      + "measuringValueStep.id=:measuringValueStepId and "
                                                                      + "(measuringValueCalculation.id=:measuringValueAverageCalculationId or "
                                                                      + "measuringValueCalculation.id=:measuringValueSumCalculationId) and "
                                                                      + "date between :startDate and :endDate");
                                      query.setParameter("measuringParameterId", measuringParameter
                                                      .getId());
                                      query.setParameter("startDate", periodStart.getTime());
                                      query.setParameter("endDate", end);
                                      query.setParameter("measuringValueAverageCalculationId",
                                                      measuringValueAverageCalculation.getId());
                                      query.setParameter("measuringValueSumCalculationId",
                                                      measuringValueSumCalculation.getId());
                                      query.setParameter("measuringValueStepId", measuringValueStep
                                                      .getId());
                                      int countDel = query.executeUpdate();
              
                                      while (periodEnd.getTime().before(end)
                                                      || periodEnd.getTime().equals(end)) {
                                              // Average
                                              query = entityManager
                                                              .createQuery("select avg(mv.value) from MeasuringValue mv where "
                                                                              + "mv.measuringParameter.id=:measuringParameterId and "
                                                                              + "mv.date between :startDate and :endDate and measuringValueStep=1 "
                                                                              + "and measuringValueCalculation=1");
                                              query.setParameter("measuringParameterId", measuringParameter
                                                              .getId());
                                              query.setParameter("startDate", periodStart.getTime());
                                              query.setParameter("endDate", periodEnd.getTime());
                                              Double avg = (Double) query.getSingleResult();
                                              MeasuringValue mv = new MeasuringValue();
                                              mv.setDate(periodStart.getTime());
                                              mv.setValue(avg);
                                              mv.setMeasuringParameter(measuringParameter);
                                              mv
                                                              .setMeasuringValueCalculation(measuringValueAverageCalculation);
                                              mv.setMeasuringValueStep(measuringValueStep);
                                              entityManager.persist(mv);
              
                                              if (c.increment()) {
                                                      entityManager.flush();
                                                      entityManager.clear();
                                              }
              
                                              // Sum
                                              query = entityManager
                                                              .createQuery("select sum(mv.value) from MeasuringValue mv where "
                                                                              + "mv.measuringParameter.id=:measuringParameterId and "
                                                                              + "mv.date between :startDate and :endDate and measuringValueStep=1 "
                                                                              + "and measuringValueCalculation=1");
                                              query.setParameter("measuringParameterId", measuringParameter
                                                              .getId());
                                              query.setParameter("startDate", periodStart.getTime());
                                              query.setParameter("endDate", periodEnd.getTime());
                                              Double sum = (Double) query.getSingleResult();
                                              mv = new MeasuringValue();
                                              mv.setDate(periodStart.getTime());
                                              mv.setValue(sum);
                                              mv.setMeasuringParameter(measuringParameter);
                                              mv.setMeasuringValueCalculation(measuringValueSumCalculation);
                                              mv.setMeasuringValueStep(measuringValueStep);
                                              entityManager.persist(mv);
              
                                              if (c.increment()) {
                                                      entityManager.flush();
                                                      entityManager.clear();
                                              }
              
                                              periodStart.add(Calendar.DATE, 1);
                                              periodEnd.add(Calendar.DATE, 1);
                                      }
              
                                      // Months Statistics
                                      periodStart.setTime(start);
              
                                      periodStart.set(Calendar.DATE, 1);
                                      periodStart.set(Calendar.HOUR_OF_DAY, 0);
                                      periodStart.set(Calendar.MINUTE, 0);
              
                                      periodStart.set(Calendar.MINUTE, 0);
                                      periodStart.set(Calendar.SECOND, 0);
                                      periodStart.set(Calendar.MILLISECOND, 0);
                                      periodEnd.setTime(periodStart.getTime());
                                      periodEnd.add(Calendar.MONTH, 1);
              
                                      measuringValueStep = entityManager
                                                      .find(MeasuringValueStep.class, 4);
              
                                      query = entityManager
                                                      .createQuery("delete from MeasuringValue where "
                                                                      + "measuringParameter.id=:measuringParameterId and "
                                                                      + "measuringValueStep.id=:measuringValueStepId and "
                                                                      + "(measuringValueCalculation.id=:measuringValueAverageCalculationId or "
                                                                      + "measuringValueCalculation.id=:measuringValueSumCalculationId) and "
                                                                      + "date between :startDate and :endDate");
                                      query.setParameter("measuringParameterId", measuringParameter
                                                      .getId());
                                      query.setParameter("startDate", periodStart.getTime());
                                      query.setParameter("endDate", end);
                                      query.setParameter("measuringValueAverageCalculationId",
                                                      measuringValueAverageCalculation.getId());
                                      query.setParameter("measuringValueSumCalculationId",
                                                      measuringValueSumCalculation.getId());
                                      query.setParameter("measuringValueStepId", measuringValueStep
                                                      .getId());
                                      countDel = query.executeUpdate();
              
                                      while (periodEnd.getTime().before(end)
                                                      || periodEnd.getTime().equals(end)) {
                                              // Average
                                              query = entityManager
                                                              .createQuery("select avg(mv.value) from MeasuringValue mv where "
                                                                              + "mv.measuringParameter.id=:measuringParameterId and "
                                                                              + "mv.date between :startDate and :endDate and measuringValueStep=1 "
                                                                              + "and measuringValueCalculation=1");
                                              query.setParameter("measuringParameterId", measuringParameter
                                                              .getId());
                                              query.setParameter("startDate", periodStart.getTime());
                                              query.setParameter("endDate", periodEnd.getTime());
                                              Double avg = (Double) query.getSingleResult();
                                              MeasuringValue mv = new MeasuringValue();
                                              mv.setDate(periodStart.getTime());
                                              mv.setValue(avg);
                                              mv.setMeasuringParameter(measuringParameter);
                                              mv
                                                              .setMeasuringValueCalculation(measuringValueAverageCalculation);
                                              mv.setMeasuringValueStep(measuringValueStep);
                                              entityManager.persist(mv);
              
                                              if (c.increment()) {
                                                      entityManager.flush();
                                                      entityManager.clear();
                                              }
              
                                              // Sum
                                              query = entityManager
                                                              .createQuery("select sum(mv.value) from MeasuringValue mv where "
                                                                              + "mv.measuringParameter.id=:measuringParameterId and "
                                                                              + "mv.date between :startDate and :endDate and measuringValueStep=1 "
                                                                              + "and measuringValueCalculation=1");
                                              query.setParameter("measuringParameterId", measuringParameter
                                                              .getId());
                                              query.setParameter("startDate", periodStart.getTime());
                                              query.setParameter("endDate", periodEnd.getTime());
                                              Double sum = (Double) query.getSingleResult();
                                              mv = new MeasuringValue();
                                              mv.setDate(periodStart.getTime());
                                              mv.setValue(sum);
                                              mv.setMeasuringParameter(measuringParameter);
                                              mv.setMeasuringValueCalculation(measuringValueSumCalculation);
                                              mv.setMeasuringValueStep(measuringValueStep);
                                              entityManager.persist(mv);
              
                                              if (c.increment()) {
                                                      entityManager.flush();
                                                      entityManager.clear();
                                              }
              
                                              periodStart.add(Calendar.MONTH, 1);
                                              periodEnd.add(Calendar.MONTH, 1);
                                      }
                              }
                              logger.info("[{0}] saving...", dataSource.getName());
                      }
              
                      public void readCurrentValues(Date date, DataSource dataSource) {
                              try {
                                      logger.info("[{0}] updating current values...", dataSource
                                                      .getName());
                                      MemographDriver memographDriver = MemographAdapterProperties
                                                      .getProperties(dataSource).getMemographDriver();
              
                                      if (!memographDriver.touchConnection()) {
                                              logger.error("[{0}] Memograph offline!", dataSource.getName());
                                              return;
                                      }
              
                                      MemographConfigurationBlock mc = getCurrentMemographConfiguration(dataSource);
              
                                      Map<MemographChannel, DataSourceChannel> parameterChannels = new HashMap<MemographChannel, DataSourceChannel>();
              
                                      for (MemographChannel channel : mc.getChannelsOrdered()) {
                                              Query q = entityManager
                                                              .createQuery("select dsc from DataSource ds inner join ds.dataSourceChannels dsc where ds.id=:dataSourceId and dsc.channel=:channel");
                                              q.setParameter("dataSourceId", dataSource.getId());
                                              q.setParameter("channel", channel.getName());
                                              List<DataSourceChannel> dataSourceChannels = q.getResultList();
                                              if (dataSourceChannels.size() == 1) {
                                                      parameterChannels.put(channel, dataSourceChannels.get(0));
                                              }
                                      }
              
                                      Map<MemographChannel, Double> values = memographDriver
                                                      .currentValues(parameterChannels.keySet());
              
                                      for (Entry<MemographChannel, DataSourceChannel> parameterChannel : parameterChannels
                                                      .entrySet()) {
                                              MeasuringParameter mp = parameterChannel.getValue()
                                                              .getMeasuringParameter();
                                              MeasuringParameterLiveInfo mvli = new MeasuringParameterLiveInfo();
              
                                              mvli.setMeasuringParameter(mp);
              
                                              Calendar calc = Calendar.getInstance();
                                              calc.setTime(date);
                                              calc.add(Calendar.DATE, -1);
                                              Date oneDayAgo = calc.getTime();
              
                                              Query q = entityManager
                                                              .createQuery("select mv from MeasuringValue mv where "
                                                                              + "mv.measuringParameter.id=:measuringParameterId and "
                                                                              + "mv.date between :start and :end and "
                                                                              + "mv.measuringValueCalculation.id=:measuringValueCalculationId and "
                                                                              + "mv.measuringValueStep.id=:measuringValueStepId");
              
                                              q.setParameter("start", oneDayAgo);
                                              q.setParameter("end", date);
                                              q.setParameter("measuringValueStepId", 1);
                                              q.setParameter("measuringValueCalculationId", 1);
                                              q.setParameter("measuringParameterId", mp.getId());
              
                                              List<MeasuringValue> measuringValues = q.getResultList();
              
                                              mvli.setMeasuringValues(measuringValues);
                                              // logger.info("[{0}] [{1}] mvs setted", dataSource.getName(),
                                              // mp
                                              // .getName());
              
                                              q = entityManager
                                                              .createQuery("select max(mv.date) from MeasuringValue mv where "
                                                                              + "mv.measuringParameter.id=:measuringParameterId and "
                                                                              + "mv.measuringValueCalculation.id=:measuringValueCalculationId "
                                                                              + "and mv.measuringValueStep.id=:measuringValueStepId");
                                              q.setParameter("measuringValueStepId", 3);
                                              q.setParameter("measuringValueCalculationId", 1);
                                              q.setParameter("measuringParameterId", mp.getId());
                                              // logger.info("[{0}] [{1}] calculating max date...", dataSource
                                              // .getName(), mp.getName());
              
                                              Date lastDate = (Date) q.getSingleResult();
                                              // logger.info("[{0}] [{1}] max date calculated!", dataSource
                                              // .getName(), mp.getName());
              
                                              try {
                                                      q = entityManager
                                                                      .createQuery("select mv.value from MeasuringValue mv where "
                                                                                      + "mv.measuringParameter.id=:measuringParameterId and "
                                                                                      + "mv.measuringValueCalculation.id=:measuringValueCalculationId "
                                                                                      + "and mv.measuringValueStep.id=:measuringValueStepId "
                                                                                      + "and date=:date");
                                                      q.setParameter("measuringValueStepId", 3);
                                                      q.setParameter("measuringValueCalculationId", 1);
                                                      q.setParameter("measuringParameterId", mp.getId());
                                                      q.setParameter("date", lastDate);
                                                      // logger.info("[{0}] [{1}] calculating day avg...",
                                                      // dataSource.getName(), mp.getName());
                                                      Double dayAvg = (Double) q.getSingleResult();
              
                                                      mvli.setAvg(dayAvg);
                                                      // logger.info("[{0}] [{1}] day avg calculated!", dataSource
                                                      // .getName(), mp.getName());
                                              } catch (Exception e) {
                                                      // logger.error("[{0}] Error calculating last Day Average!",
                                                      // mp.getName());
                                              }
              
                                              try {
                                                      q = entityManager
                                                                      .createQuery("select mv.value from MeasuringValue mv where "
                                                                                      + "mv.measuringParameter.id=:measuringParameterId and "
                                                                                      + "mv.measuringValueCalculation.id=:measuringValueCalculationId and "
                                                                                      + "mv.measuringValueStep.id=:measuringValueStepId and "
                                                                                      + "date=:date");
                                                      q.setParameter("measuringValueStepId", 3);
                                                      q.setParameter("measuringValueCalculationId", 2);
                                                      q.setParameter("measuringParameterId", mp.getId());
                                                      q.setParameter("date", lastDate);
                                                      // logger.info("[{0}] [{1}] calculating sum...", dataSource
                                                      // .getName(), mp.getName());
                                                      Double daySum = (Double) q.getSingleResult();
              
                                                      mvli.setSum(daySum);
                                                      // logger.info("[{0}] [{1}] sum calculated!", dataSource
                                                      // .getName(), mp.getName());
                                              } catch (Exception e) {
                                                      // logger.error("[{0}] Error calculating last Day Sum!", mp
                                                      // .getName());
                                              }
              
                                              calc.setTime(date);
                                              calc.add(Calendar.HOUR_OF_DAY, -2);
                                              Date oneHourAgo = calc.getTime();
              
                                              try {
                                                      q = entityManager
                                                                      .createQuery("select avg(mv.value) from MeasuringValue mv where "
                                                                                      + "mv.measuringParameter.id=:measuringParameterId and "
                                                                                      + "mv.date between :start and :end and "
                                                                                      + "mv.measuringValueCalculation.id=:measuringValueCalculationId and "
                                                                                      + "mv.measuringValueStep.id=:measuringValueStepId");
              
                                                      q.setParameter("start", oneHourAgo);
                                                      q.setParameter("end", date);
                                                      q.setParameter("measuringValueStepId", 1);
                                                      q.setParameter("measuringValueCalculationId", 1);
                                                      q.setParameter("measuringParameterId", mp.getId());
                                                      // logger.info("[{0}] [{1}] calculating 2 hours avg...",
                                                      // dataSource.getName(), mp.getName());
                                                      Double twoHoursAverage = (Double) q.getSingleResult();
              
                                                      mvli.setTwoHoursAvg(twoHoursAverage);
                                                      // logger.info("[{0}] [{1}] 2 hours avg calculated",
                                                      // dataSource.getName(), mp.getName());
                                              } catch (Exception e) {
                                                      // logger.error("[{0}] Error calculating 2 hours Average!",
                                                      // mp
                                                      // .getName());
                                              }
              
                                              try {
                                                      q = entityManager
                                                                      .createQuery("select stddev(mv.value) from MeasuringValue mv where "
                                                                                      + "mv.measuringParameter.id=:measuringParameterId and "
                                                                                      + "mv.date between :start and :end and "
                                                                                      + "mv.measuringValueCalculation.id=:measuringValueCalculationId and "
                                                                                      + "mv.measuringValueStep.id=:measuringValueStepId");
              
                                                      q.setParameter("start", oneDayAgo);
                                                      q.setParameter("end", date);
                                                      q.setParameter("measuringValueStepId", 1);
                                                      q.setParameter("measuringValueCalculationId", 1);
                                                      q.setParameter("measuringParameterId", mp.getId());
                                                      // logger.info("[{0}] [{1}] calculating stddev...",
                                                      // dataSource
                                                      // .getName(), mp.getName());
                                                      Double stdDev = (Double) q.getSingleResult();
              
                                                      mvli.setStdDev(stdDev);
                                                      // logger.info("[{0}] [{1}] stddev calculated", dataSource
                                                      // .getName(), mp.getName());
                                              } catch (Exception e) {
                                                      // logger.error("[{0}] Error calculating Standard Deviation!",
                                                      // mp.getName());
                                              }
              
                                              mvli.setValue(values.get(parameterChannel.getKey()));
                                              mvli.setDate(date);
                                              try {
                                                      currentValuesManager.setValue(parameterChannel.getValue()
                                                                      .getMeasuringParameter(), mvli);
                                              } catch (Exception e) {
                                                      logger
                                                                      .error(
                                                                                      "[{0}] [{1}] live values bean couldn't be updated!",
                                                                                      dataSource.getName(), mp.getName());
                                              }
                                              // logger.info("[{0}] [{1}] processed", dataSource.getName(), mp
                                              // .getName());
                                      }
              
                              } catch (Exception e) {
                                      Query q = entityManager
                                                      .createQuery("select dsc.measuringParameter from DataSource ds inner join ds.dataSourceChannels dsc where ds.id=:dataSourceId");
                                      q.setParameter("dataSourceId", dataSource.getId());
                                      List<MeasuringParameter> measuringParameters = q.getResultList();
                                      e.printStackTrace();
              
                                      for (MeasuringParameter measuringParameter : measuringParameters) {
                                              try {
                                                      currentValuesManager.setValue(measuringParameter, null);
                                              } catch (Exception e2) {
                                                      logger
                                                                      .error(
                                                                                      "[{0}] [{1}] live values bean couldn't be updated!",
                                                                                      dataSource.getName(), measuringParameter
                                                                                                      .getName());
                                              }
                                      }
                              }
                              return;
                      }
              
                      public void destroy() {
                      }
              }
              

              • 4. Re: EntityManager, concurrency, long running methods
                Imanol Studer Newbie

                and the interface:


                
                package ch.sedd.osiris.datareaders.memograph;
                
                import java.util.Date;
                import java.util.Map;
                
                import javax.ejb.Local;
                
                import ch.sedd.osiris.entity.DataSource;
                import ch.sedd.osiris.entity.MeasuringParameter;
                import ch.sedd.osiris.util.TimeInterval;
                
                @Local
                public interface MemographAdapter {
                        public void updateMemographConfigurations(DataSource dataSource)
                                        throws Exception;
                
                        public void updateMemographDatas(DataSource dataSource) throws Exception;
                
                        public void updateMeasuringParametersFromArchive(
                                        Map<MeasuringParameter, TimeInterval> outOfDate,
                                        Date firstOutOfDate, Date lastOutOfDate, DataSource dataSource)
                                        throws Exception;
                
                        public void updateStatistics(
                                        Map<MeasuringParameter, TimeInterval> outOfDate,
                                        DataSource dataSource) throws Exception;
                
                        public void readCurrentValues(Date date, DataSource dataSource);
                        
                        public void destroy();
                }
                

                • 5. Re: EntityManager, concurrency, long running methods
                  Imanol Studer Newbie

                  persistence.xml


                  <?xml version="1.0" encoding="UTF-8"?>
                  
                  <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                       xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                       version="1.0">
                  
                       <persistence-unit name="OsirisSeam" transaction-type="JTA">
                            <provider>org.hibernate.ejb.HibernatePersistence</provider>
                            <jta-data-source>java:jdbc/osirisdb2</jta-data-source>
                            <non-jta-data-source>java:jdbc/osirisdb2</non-jta-data-source>
                            <properties>
                                 <property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect" />
                                 <property name="hibernate.show_sql" value="false" />
                                 <property name="hibernate.hbm2ddl.auto" value="update" />
                                 <property name="hibernate.transaction.factory_class"
                                      value="org.hibernate.ejb.transaction.JoinableCMTTransactionFactory" />
                                 <property name="hibernate.transaction.manager_lookup_class"
                                      value="org.hibernate.transaction.JBossTransactionManagerLookup" />
                                 <property name="hibernate.transaction.flush_before_completion"
                                      value="true" />
                                 <property name="hibernate.cache.use_second_level_cache"
                                      value="false" />
                                 <property name="hibernate.jdbc.batch_size" value="50" />
                                 <property name="jboss.entity.manager.factory.jndi.name"
                                      value="java:/OsirisSeamEntityManagerFactory" />
                                 <property name="jboss.entity.manager.jndi.name" value="java:/OsirisSeamEntityManager" />
                            </properties>
                       </persistence-unit>
                  
                  </persistence>
                  




                  components.xml


                  <?xml version="1.0" encoding="UTF-8"?>
                  <components xmlns="http://jboss.com/products/seam/components"
                       xmlns:core="http://jboss.com/products/seam/core" xmlns:persistence="http://jboss.com/products/seam/persistence"
                       xmlns:drools="http://jboss.com/products/seam/drools" xmlns:bpm="http://jboss.com/products/seam/bpm"
                       xmlns:security="http://jboss.com/products/seam/security" xmlns:mail="http://jboss.com/products/seam/mail"
                       xmlns:async="http://jboss.com/products/seam/async" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                       xmlns:document="http://jboss.com/products/seam/document" xmlns:web="http://jboss.com/products/seam/web"
                       xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd 
                                       http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.1.xsd
                                   http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd 
                                   http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                                   http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                                   http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                                   http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                                   http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd
                                   http://jboss.com/products/seam/document http://jboss.com/products/seam/document-2.1.xsd
                                   http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd">
                       <core:init debug="true" jndi-pattern="OsirisSeam/#{ejbName}/local" />
                       <core:manager concurrent-request-timeout="500"
                            conversation-timeout="120000" conversation-id-parameter="cid"
                            parent-conversation-id-parameter="pid" />
                  
                       <async:quartz-dispatcher></async:quartz-dispatcher>
                  
                       <document:document-store use-extensions="true" />
                       <persistence:managed-persistence-context 
                            name="entityManager" auto-create="true"
                            persistence-unit-jndi-name="java:/OsirisSeamEntityManagerFactory" />
                       <persistence:entity-manager-factory
                            name="entityManagerFactory" persistence-unit-name="OsirisSeam" />
                  
                       <drools:rule-base name="securityRules">
                            <drools:rule-files>
                                 <value>/security.drl</value>
                            </drools:rule-files>
                       </drools:rule-base>
                  
                       <security:rule-based-permission-resolver
                            security-rules="#{securityRules}" />
                  
                       <security:identity authenticate-method="#{authenticator.authenticate}"
                            remember-me="true" />
                  
                       <event type="org.jboss.seam.security.notLoggedIn">
                            <action execute="#{redirect.captureCurrentView}" />
                       </event>
                       <event type="org.jboss.seam.security.loginSuccessful">
                            <action execute="#{redirect.returnToCapturedView}" />
                       </event>
                  
                       <mail:mail-session host="localhost" port="2525"
                            username="test" password="test" />
                  
                       <web:character-encoding-filter encoding="UTF-8"
                            override-client="true" url-pattern="*.xhtml" />
                  </components>
                  

                  • 6. Re: EntityManager, concurrency, long running methods
                    Stuart Douglas Master

                    Are you sure it is the entityManger that is blocking and not the database? What serialization mode are you running in? Long running transactions like this should generally be avoided, becuase they cause the database to hold locks for a long time, which can cause other processes to block.

                    • 7. Re: EntityManager, concurrency, long running methods
                      Stuart Douglas Master

                      If you set your flush mode to manual (assuming it is not already) you may see a massive increase in the performance of these methods, otherwise the entitymanager is flushed every time you make an entityManager call, which is an O(n) operation, where n is the number of entities in the entityManager, and it gets slower every iteration of the loop

                      • 8. Re: EntityManager, concurrency, long running methods
                        Imanol Studer Newbie
                        I see. so the database locks the actions on the table while a transaction is running. i tried to make a select call to the database while running one of these transactions and it blocked. thanks for the hint.
                        then i'll extract the persist and update calls to separate methods. i think the performance of these "insert-transactions" should be ok. i'm working with jdbc batchs
                        (<property name="hibernate.jdbc.batch_size" value="50" />). what's taking the most time are the other calls to the external device (memographDriver).

                        by the way, there's one thing more. when the call takes more time than a few minutes, i get a classnotfoundexception when calling 'currentValuesManager' (at the and of the 'readCurrentValues' method). it's a stateful session bean.

                        ->>     @In(value = "#{currentValuesManager}")
                             private CurrentValuesManager currentValuesManager;

                        Code:
                        `
                        @Stateful
                        @Scope(ScopeType.APPLICATION)
                        @Name("currentValuesManager")
                        @Synchronized(timeout=10000)
                        public class CurrentValuesManagerBean implements CurrentValuesManager {
                             private volatile Map<MeasuringParameter, MeasuringParameterLiveInfo> currentValues = new HashMap<MeasuringParameter, MeasuringParameterLiveInfo>();

                             public void setValue(MeasuringParameter measuringParameter,
                                       MeasuringParameterLiveInfo value) {
                                  currentValues.put(measuringParameter, value);
                             }

                             public MeasuringParameterLiveInfo getValue(
                                       MeasuringParameter measuringParameter) {
                                  return currentValues.get(measuringParameter);
                             }

                             @Destroy
                             @Remove
                             public void destroy() {
                             }
                        }
                        `

                        Here's the Stacktrace of the Exception:
                        23:30:44,403 ERROR [STDERR] java.lang.ClassNotFoundException: No ClassLoaders found for: ch.sedd.osiris.session.seam.CurrentValuesManagerBean
                        23:30:44,403 ERROR [STDERR]      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
                        23:30:44,403 ERROR [STDERR]      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                        23:30:44,403 ERROR [STDERR]      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                        23:30:44,403 ERROR [STDERR]      at java.lang.Class.forName0(Native Method)
                        23:30:44,403 ERROR [STDERR]      at java.lang.Class.forName(Class.java:247)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.io.JBossObjectInputStream.resolveClass(JBossObjectInputStream.java:141)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.io.JBossObjectInputStream$1.resolveClass(JBossObjectInputStream.java:127)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.classmetamodel.ClassMetamodelFactory.resolveClassByName(ClassMetamodelFactory.java:266)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.classmetamodel.ClassMetamodelFactory.getClassMetaData(ClassMetamodelFactory.java:289)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.classmetamodel.StreamingClass.readStream(StreamingClass.java:72)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:381)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.persister.ArrayPersister.readObjectArray(ArrayPersister.java:196)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.persister.ArrayPersister.readData(ArrayPersister.java:172)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.io.JBossObjectInputStream.readObjectOverride(JBossObjectInputStream.java:163)
                        23:30:44,403 ERROR [STDERR]      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.serial.io.MarshalledObject.get(MarshalledObject.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:793)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateful.StatefulBeanContext.getInterceptorInstances(StatefulBeanContext.java:781)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.interceptor.LifecycleInvocationContextImpl.getLifecycleInvocationContext(LifecycleInvocationContextImpl.java:65)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postActivate(LifecycleInterceptorHandler.java:143)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateful.StatefulContainer.invokePostActivate(StatefulContainer.java:409)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateful.StatefulBeanContext.postActivate(StatefulBeanContext.java:388)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:316)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:387)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
                        23:30:44,403 ERROR [STDERR]      at $Proxy131.setValue(Unknown Source)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        23:30:44,403 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                        23:30:44,403 ERROR [STDERR]      at org.javassist.tmp.java.lang.Object_$$_javassist_6.setValue(Object_$$_javassist_6.java)
                        23:30:44,403 ERROR [STDERR]      at ch.sedd.osiris.datareaders.memograph.MemographAdapterBean.readCurrentValues(MemographAdapterBean.java:875)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        23:30:44,403 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:29)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:31)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        23:30:44,403 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
                        23:30:44,403 ERROR [STDERR]      at $Proxy102.readCurrentValues(Unknown Source)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        23:30:44,403 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                        23:30:44,403 ERROR [STDERR]      at org.javassist.tmp.java.lang.Object_$$_javassist_5.readCurrentValues(Object_$$_javassist_5.java)
                        23:30:44,403 ERROR [STDERR]      at ch.sedd.osiris.datareaders.OsirisMemographUpdaterBean.update(OsirisMemographUpdaterBean.java:92)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        23:30:44,403 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:29)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:31)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        23:30:44,403 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
                        23:30:44,403 ERROR [STDERR]      at $Proxy111.update(Unknown Source)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        23:30:44,403 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:52)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                        23:30:44,403 ERROR [STDERR]      at org.javassist.tmp.java.lang.Object_$$_javassist_4.update(Object_$$_javassist_4.java)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                        23:30:44,403 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        23:30:44,403 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:138)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.async.AsynchronousInvocation$1.process(AsynchronousInvocation.java:62)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.async.AsynchronousInvocation.execute(AsynchronousInvocation.java:44)
                        23:30:44,403 ERROR [STDERR]      at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:243)
                        23:30:44,403 ERROR [STDERR]      at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
                        23:30:44,403 ERROR [STDERR]      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
                        • 9. Re: EntityManager, concurrency, long running methods
                          Imanol Studer Newbie

                          i forgot the interface:


                          @Local
                          public interface CurrentValuesManager {
                               public void setValue(MeasuringParameter measuringParameter,
                                         MeasuringParameterLiveInfo value);
                          
                               public MeasuringParameterLiveInfo getValue(
                                         MeasuringParameter measuringParameter);
                          
                               public void destroy();
                          }