Examples of DataAccessException


Examples of com.adito.jdbc.DataAccessException

    public void createResourceWithDataAccessException() throws DuplicateResourceNameException {
        Resource resource = getDefaultResource();

        expect(resourceDatabase.isResourceNameInUse(resource.getResourceName(), 1)).andReturn(false);
        expect(resourceDatabase.insertResource(resource)).andThrow(
            new DataAccessException("Failed to insert resource."));
        CoreEvent changeEvent = getChangeEvent(resourceService.getCreateEventId(), CoreEvent.STATE_UNSUCCESSFUL);
        coreEventService.fireCoreEvent(eqCoreEvent(changeEvent));
        mocksControl.replay();

        try {
View Full Code Here

Examples of com.adito.jdbc.DataAccessException

        Resource resource = getDefaultResource();

        expect(resourceDatabase.getResourceById(resource.getResourceId())).andReturn(resource);
        policyService.checkPermission(resourceType, PolicyConstants.PERM_EDIT_AND_ASSIGN, (SessionInfo) null);
        resourceDatabase.updateResource(resource);
        expectLastCall().andThrow(new DataAccessException("Failed to update resource."));
        CoreEvent changeEvent = getChangeEvent(resourceService.getEditEventId(), CoreEvent.STATE_UNSUCCESSFUL);
        coreEventService.fireCoreEvent(eqCoreEvent(changeEvent));
        mocksControl.replay();

        try {
View Full Code Here

Examples of com.adito.jdbc.DataAccessException

    public void removeResourceWithDataAccessException() throws NoPermissionException {
        Resource resource = getDefaultResource();

        policyService.checkPermission(resourceType, PolicyConstants.PERM_DELETE, (SessionInfo) null);
        resourceDatabase.removeResource(resource.getResourceId());
        expectLastCall().andThrow(new DataAccessException("Failed to remove resource."));
        CoreEvent deleteEvent = getDeleteEvent(resourceService.getRemoveEventId(), CoreEvent.STATE_UNSUCCESSFUL);
        coreEventService.fireCoreEvent(eqCoreEvent(deleteEvent));
        mocksControl.replay();

        try {
View Full Code Here

Examples of com.celum.nyx.DataAccessException

            context = new VelocityContext();
            for (Map.Entry<String, ?> e : values.entrySet()) {
                context.put(e.getKey(), e.getValue());
            }
        } catch (Exception e) {
            throw new DataAccessException("Error in velocity interceptor:" + e.getMessage(), e);
        }
    }
View Full Code Here

Examples of com.et.ar.exception.DataAccessException

            if (log.isDebugEnabled()){
              log.debug((t2-t1)/1000.0 + "s " + sqlInfo);
            }
        }
        catch(SQLException e1){
        throw new DataAccessException(sqlInfo, e1);
        }
        finally{
            try{
                if (rs != null){
                    rs.close();
                }
                if (pstmt != null){
                    pstmt.close();
                }
            }
            catch(SQLException e){
                throw new DataAccessException(e);
            }
        }
       
        return data;
    }
View Full Code Here

Examples of com.et.ar.exception.DataAccessException

            if (log.isDebugEnabled()){
              log.debug((t2-t1)/1000.0 + "s " + sqlInfo);
            }
        }
        catch(SQLException e){
            throw new DataAccessException(sqlInfo, e);
        }
        finally{
            try{
                if (pstmt != null){
                    pstmt.close();
                }
            }
            catch(SQLException e){
                throw new DataAccessException(e);
            }
        }
        return updated;
    }
View Full Code Here

Examples of com.et.ar.exception.DataAccessException

            if (log.isDebugEnabled()){
              log.debug((t2-t1)/1000.0 + "s " + sqlInfo);
            }
        }
        catch(SQLException e){
            throw new DataAccessException(sqlInfo, e);
        }
        finally{
            try{
                if (rs != null){
                    rs.close();
                }
                if (pstmt != null){
                    pstmt.close();
                }
            }
            catch(SQLException e){
                throw new DataAccessException(e);
            }
        }
        return scalar;
    }
View Full Code Here

Examples of com.et.ar.exception.DataAccessException

            else{
                con = transaction.getConnection();
            }
        }
        catch(SQLException e){
            throw new DataAccessException(e);
        }
    }
View Full Code Here

Examples of com.et.ar.exception.DataAccessException

            if (transaction == null){
                connectionProvider.closeConnection(con);
            }
        }
        catch(SQLException e){
            throw new DataAccessException(e);
        }
    }
View Full Code Here

Examples of com.funambol.syncclient.sps.DataAccessException

            pobj = PersistentStore.getPersistentObject(KEY);   
            cache = (CacheData)pobj.getContents();
        }
        catch (Exception e){
            StaticDataHelper.log("EventCache(): " + e.toString());
            throw new DataAccessException("error accessing cache.");
        }
       
        if(cache == null){
            StaticDataHelper.log("EventCache: cache empty, initialize it.");
            cache = new CacheData();
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.