Package org.springmodules.prevayler.support

Examples of org.springmodules.prevayler.support.PrevaylerTransactionException


        this.flushed = false;
    }
   
    public Object execute(PrevaylerCallback callback) {
        if (this.flushed) {
            throw new PrevaylerTransactionException("Error: session already flushed and closed.");
        } else {
            // Enqueue a copy of the callback for later execution through prevayler at commit time:
            PrevaylerCallback copiedCallback = (PrevaylerCallback) this.deepCopy(callback);
            this.executionQueue.add(copiedCallback);
            // Locally execute the callback:
View Full Code Here


        }
    }
   
    public Object execute(SystemCallback callback) {
        if (this.flushed) {
            throw new PrevaylerTransactionException("Error: session already flushed and closed.");
        } else {
            // Directly execute the callback into the system:
            return this.system.execute(callback);
            // No need to enqueue because this is a callback to directly executed into the system.
        }
View Full Code Here

        }
    }
   
    public void flush(Prevayler prevayler) {
        if (this.flushed) {
            throw new PrevaylerTransactionException("Error: session already flushed and closed.");
        } else {
            CompositeTransactionCommand command = new CompositeTransactionCommand(this.executionQueue);
            prevayler.execute(command);
        }
    }
View Full Code Here

            out.writeObject(target);
            out.flush();
            in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()));
            replica = in.readObject();
        } catch(Exception ex) {
            throw new PrevaylerTransactionException("Internal transaction error!", ex);
        } finally {
            try {
                if (out != null) out.close();
                if (in != null) in.close();
            } catch (IOException ex) {
View Full Code Here

        this.endLock.lock();
        try {
            if (this.activeSession == null || this.activeSession != session) {
                String msg = "Wrong session: no active session, or session timed out.";
                logger.info(msg);
                throw new PrevaylerTransactionException(msg);
            } else {
                session.flush(this.configuration.getPrevaylerInstance());
            }
        } finally {
            this.releaseAll();
View Full Code Here

        this.endLock.lock();
        try {
            if (this.activeSession == null || this.activeSession != session) {
                String msg = "Wrong session: no active session, or session timed out.";
                logger.info(msg);
                throw new PrevaylerTransactionException(msg);
            }
        } finally {
            this.releaseAll();
            this.endLock.unlock();
        }
View Full Code Here

        logger.debug("Executing callback into Prevayler.");
        try {
            Prevayler prevayler = this.configuration.getPrevaylerInstance();
            return prevayler.execute(new TransactionCommand(callback));
        } catch (Exception ex) {
            throw new PrevaylerTransactionException("Error while executing callback.", ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.springmodules.prevayler.support.PrevaylerTransactionException

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