Пример #1
0
        /**
         * The method does the following:<p>
         * 1.in case of none atomic command<p>
         *  - execute the command using the command executor<p>
         *  - notify all waiting thread about the command execution<p>
         * 2.in case of atomic command<p>
         *  - execute the command using the command executor<p>
         *  - notify all waiting thread about the command execution only<p>
         *    if the current command is the last element in the atomic command
         *
         * @param modelCommand
         * @throws PlanckDBException
         */
        public void doJobs(Command modelCommand)
        {
            bool consume=true;
            if( modelCommand.getTransaction()==PlanckDBConstants.TRUE && modelCommand.GetSessionId()==sessionMetaData.GetSessionId()){
                consume=false;
            }
            if(consume){
                commandExecutor.consume(modelCommand);
            }
            if(atomicContainer.isPartOfAtomicCommand(modelCommand)){
                Command rootCommand = atomicContainer.update(modelCommand);
                if(rootCommand!=null){
                    lock(rootCommand){
                        Monitor.PulseAll(rootCommand);
                    }
                }

            }else{
                lock(modelCommand){
                     Monitor.PulseAll(modelCommand);
                }
            }

            log.info("message done version : "+modelCommand.getVersion()+" id "+modelCommand.getEntityId());
        }