Examples of SFSBBeanState


Examples of com.sun.ejb.spi.sfsb.store.SFSBBeanState

                try {
                    internalConn = connGroup._internalConn;
                    externalConn = connGroup._externalConn;

                    for(int i=0; i<beanStates.length; i++) {
                        SFSBBeanState sfsBean = beanStates[i];
                        boolean isNew = sfsBean.isNew();
                        if(_logger.isLoggable(Level.FINEST)) {
                            _logger.log(Level.FINEST,
                                        "HAEjbStore.  aggregate save  : is .isnew =" + isNew);
                        }
                        if (isNew) {
                            insertSFSBeanNoCommit(sfsBean, internalConn);
                        }
                        else {
                            updateSFSBeanNoCommit(sfsBean, internalConn);
                        }
                        if(this.isMonitoringEnabled()) {
                            //increment storage duration for each bean
                            eachEndTime = System.currentTimeMillis();
                            long storeDuration = eachEndTime - eachStartTime;
                            sfsBean.setTxCheckpointDuration(sfsBean.getTxCheckpointDuration() + storeDuration + getConnDuration);
                            eachStartTime = eachEndTime;
                        }
                    }
                    ( (Connection) internalConn).commit();
View Full Code Here

Examples of com.sun.ejb.spi.sfsb.store.SFSBBeanState

            _logger.entering("HAEjbStore", "loadBean", id);
        }
        if (id == null) {
             return null;
        }
        SFSBBeanState bean = null;
        HADBConnectionGroup connGroup = null;
        Connection internalConn = null;
        Connection externalConn = null;       
        EJBModuleStatistics stats = this.getEJBModuleStatistics();
       
View Full Code Here

Examples of com.sun.ejb.spi.sfsb.store.SFSBBeanState

     */
    protected SFSBBeanState getSFSBean(ResultSet rst) {
        if(_logger.isLoggable(Level.FINER)) {
            _logger.entering("HAEjbStore", "getSFSBean", rst);
        }
        SFSBBeanState bean = null;
        String id = null;
        byte[] beandata = null;
        String clusterid = "";
        long lastaccess = 0;
        String containerId = null;
        BufferedInputStream bis = null;
        long longContId = 0;
        try {
            if(_logger.isLoggable(Level.FINEST)) {
                _logger.log(Level.FINEST, "HAEjbStore: getSFSBean ResultSet =" + rst);
            }

            id = rst.getString(1); //bean  ID
            Blob blob = rst.getBlob(2); //beandata
            clusterid = rst.getString(3); //clusterid
            lastaccess = rst.getLong(4); //lastaccess
            containerId = rst.getString(5); //containerId
            //FIXME later this should be long in database
            longContId = (Long.valueOf(containerId)).longValue();
            //beandata = blob.getBytes( (long) 1, (int) blob.length());
            //replacing use of getBytes
            int blobLen = (int) blob.length();
            beandata = new byte[blobLen];
            DataInputStream dis = new DataInputStream(blob.getBinaryStream());
            try {
                dis.readFully (beandata, 0, blobLen);
            } catch (IOException ex) {
                _logger.log(Level.FINE,
                            "HAEjbStore: getSFSBean error getting blob data");                                           
            }
           
            if(_logger.isLoggable(Level.FINEST)) {
                _logger.log(Level.FINEST,
                            "HAEjbStore: SFSBBeanState id =" + id + " clusterid=" +
                            clusterid + " lastaccess=" + lastaccess +
                            " blob.length=" +
                            blob.length() + " beandata.length=" + beandata.length +
                            "   containerId=" + containerId);
            }

        }
        catch (SQLException sqe) {
            sqe.printStackTrace();
        }

        //bean = new SFSBBeanState(id, lastaccess, false, beandata);
        SFSBStoreManager mgr = this.manager;
        bean = new SFSBBeanState(clusterid, longContId, id, lastaccess,
                false, beandata, mgr);
       
        if(_logger.isLoggable(Level.FINER)) {
            _logger.exiting("HAEjbStore", "getSFSBean", bean);
        }
View Full Code Here

Examples of com.sun.ejb.spi.sfsb.store.SFSBBeanState

     */
    protected SFSBBeanState getSFSBean(ResultSet rst, Object beanId) {
        if(_logger.isLoggable(Level.FINER)) {
            _logger.entering("HAEjbStore", "getSFSBean", rst);
        }
        SFSBBeanState bean = null;
        String id = null;
        byte[] beandata = null;
        String clusterid = "";
        long lastaccess = 0;
        String containerId = null;
        BufferedInputStream bis = null;
        long longContId = 0;
        try {
            if(_logger.isLoggable(Level.FINEST)) {
                _logger.log(Level.FINEST, "HAEjbStore: getSFSBean ResultSet =" + rst);
            }

            id = rst.getString(1); //bean  ID
            Blob blob = rst.getBlob(2); //beandata
            clusterid = rst.getString(3); //clusterid
            lastaccess = rst.getLong(4); //lastaccess
            containerId = rst.getString(5); //containerId
            //FIXME later this should be long in database
            longContId = (Long.valueOf(containerId)).longValue();
            //beandata = blob.getBytes( (long) 1, (int) blob.length());
            //replacing use of .getBytes          
            int blobLen = (int) blob.length();
            beandata = new byte[blobLen];
            DataInputStream dis = new DataInputStream(blob.getBinaryStream());
            try {
                dis.readFully (beandata, 0, blobLen);
            } catch (IOException ex) {
                _logger.log(Level.FINE,
                    "HAEjbStore: getSFSBean error getting blob data");                                           
            }           
           
            if(_logger.isLoggable(Level.FINEST)) {
                _logger.log(Level.FINEST,
                            "HAEjbStore: SFSBBeanState id =" + id + " clusterid=" +
                            clusterid + " lastaccess=" + lastaccess +
                            " blob.length=" +
                            blob.length() + " beandata.length=" + beandata.length +
                            "   containerId=" + containerId);
            }

        }
        catch (SQLException sqe) {
            sqe.printStackTrace();
        }

        SFSBStoreManager mgr = this.manager;
        bean = new SFSBBeanState(clusterid, longContId, beanId, lastaccess,
                false, beandata, mgr);
       
        if(_logger.isLoggable(Level.FINER)) {
            _logger.exiting("HAEjbStore", "getSFSBean", bean);
        }
View Full Code Here

Examples of com.sun.ejb.spi.sfsb.store.SFSBBeanState

        PreparedStatement preparedLoadSql = null;
        String loadSql =
            "SELECT  id, beandata, clusterid, lastaccess, containerid FROM " +
            blobSfsbTable + " WHERE id = ?";
        ResultSet rst = null;
        SFSBBeanState sfsBean = null;
        try {

            haErrLoad.txStart();
            while ( ! haErrLoad.isTxCompleted() ) {                
                try {               
View Full Code Here

Examples of com.sun.ejb.spi.sfsb.store.SFSBBeanState

     */
    public SFSBBeanState getState(Object id) throws SFSBStoreManagerException {
        if(_logger.isLoggable(Level.FINER)) {
            _logger.entering("HASFSBStoreManager", "getState", id);
        }
        SFSBBeanState sfsbState = null;
        StorePool storePool = this.getStorePool();
        HAEjbStore store = null;
        try {
            store = getStore();
           
View Full Code Here

Examples of com.sun.ejb.spi.sfsb.store.SFSBBeanState

   
    private Long[] storeOriginalTxCheckpointDurations(SFSBBeanState[] beanStates) {   
        //return temporarily stored original txCheckpointDurations
        Long[] originalTxCheckpointDurations = new Long[beanStates.length];
        for(int i=0; i<beanStates.length; i++) {
            SFSBBeanState nextBeanState = beanStates[i];
            originalTxCheckpointDurations[i] =
                new Long(nextBeanState.getTxCheckpointDuration());
        }
        return originalTxCheckpointDurations;
    }
View Full Code Here

Examples of com.sun.ejb.spi.sfsb.store.SFSBBeanState

   
    private void restoreOriginalTxCheckpointDurations(SFSBBeanState[] beanStates, Long[] originalTxCheckpointDurations) {   
        //restore temporarily stored original txCheckpointDurations
        //to beanStates from originalTxCheckpointDurations
        for(int i=0; i<beanStates.length; i++) {
            SFSBBeanState nextBeanState = beanStates[i];
            long originalDuration = originalTxCheckpointDurations[i].longValue();
            nextBeanState.setTxCheckpointDuration(originalDuration);
        }
        return;
    }
View Full Code Here

Examples of com.sun.ejb.spi.sfsb.store.SFSBBeanState

   
    private void printTxCheckpointDurations(SFSBBeanState[] beanStates) {   
        //used for testing
        //System.out.println("Printing Checkpoint Durations");
        for(int i=0; i<beanStates.length; i++) {
            SFSBBeanState nextBeanState = beanStates[i];
            System.out.println("printTxCheckpointDurations for beanState[" + i + "]: "
                + nextBeanState.getTxCheckpointDuration());
        }
        return;
    }   
View Full Code Here

Examples of com.sun.ejb.spi.sfsb.store.SFSBBeanState

            store = getStore();           
            ( (HAEjbStore) store).save(beanStates, startTime);
            //added for monitoring
            if(this.isMonitoringEnabled()) {
                for(int i=0; i<beanStates.length; i++) {
                    SFSBBeanState nextBeanState = beanStates[i];
                    stats.processBeanSize(this.getBeanSize(nextBeanState));
                }
            }
            //end added for monitoring          
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.