Package com.scooterframework.orm.sqldataexpress.connection

Examples of com.scooterframework.orm.sqldataexpress.connection.UserDatabaseConnection


        bTransactionHasEnded = true;
       
        try {
            Iterator<UserDatabaseConnection> it = connList.iterator();
            while(it.hasNext()) {
                UserDatabaseConnection udc = it.next();
                DAOUtil.closeConnection(udc.getConnection());
            }
            connList.clear();
            nameConnMap.clear();
           
            bAllResourcesReleased = true;
View Full Code Here


     *
     * @param connectionName     name of a connection
     * @return UserDatabaseConnection
     */
    public UserDatabaseConnection getConnection(String connectionName) {
        UserDatabaseConnection udc = getCachedUserDatabaseConnection(connectionName);
       
        //create a new UserDatabaseConnection
        if (udc == null) {
            udc = UserDatabaseConnectionFactory.getInstance().createUserDatabaseConnection(connectionName);
            registerResource(udc.getConnectionName(), udc);
        }
       
        return udc;
    }
View Full Code Here

     */
    public UserDatabaseConnection getConnection(DatabaseConnectionContext dcc) {
        if (dcc == null) throw new IllegalArgumentException("Input DatabaseConnectionContext instance is null.");
       
        String connectionName = dcc.getConnectionName();
        UserDatabaseConnection udc = getCachedUserDatabaseConnection(connectionName);
       
        //create a new UserDatabaseConnection
        if (udc == null) {
            udc = UserDatabaseConnectionFactory.getInstance().createUserDatabaseConnection(dcc);
            registerResource(connectionName, udc);
View Full Code Here

            throw new IllegalArgumentException("Function name is empty.");
       
        String errorMessage = "Failed to get meta data info for function " + function;
        Function f = DBStore.getInstance().getFunction(function);
        if (f == null) {
          UserDatabaseConnection udc = null;
            try {
                udc = SqlExpressUtil.getUserDatabaseConnection();
                f = lookupFunction(udc, function);
            }
            catch(Exception ex) {
                errorMessage += ", because " + ex.getMessage() + ".";
            }
            finally {
                DAOUtil.closeConnection(udc.getConnection());
            }
           
            if (f != null) {
                DBStore.getInstance().addFunction(function, f);
            }
View Full Code Here

            throw new IllegalArgumentException("Stored procedure name is empty.");
       
        String errorMessage = "Failed to get meta data info for stored procedur " + storedProcedure;
        StoredProcedure sp = DBStore.getInstance().getStoredProcedure(storedProcedure);
        if (sp == null) {
          UserDatabaseConnection udc = null;
            try {
                udc = SqlExpressUtil.getUserDatabaseConnection();
                sp = lookupStoredProcedure(udc, storedProcedure);
            }
            catch(Exception ex) {
                errorMessage += ", because " + ex.getMessage() + ".";
            }
            finally {
                DAOUtil.closeConnection(udc.getConnection());
            }
           
            if (sp != null) {
                DBStore.getInstance().addStoredProcedure(storedProcedure, sp);
            }
View Full Code Here

            throw new IllegalArgumentException("tableName cannot be null.");
       
        TableInfo ti = DBStore.getInstance().getTableInfo(connName, tableName);
        if (ti != null) return ti;
       
        UserDatabaseConnection udc = null;
        try {
          udc = SqlExpressUtil.getUserDatabaseConnection(connName);
          ti = _lookupAndRegisterTableInfo(udc, tableName);
        }
        finally {
View Full Code Here

        try {
            tm.beginTransactionImplicit();

            //if (log.isDebugEnabled()) displayDS((String)inputs.get(DataProcessor.input_key_database_connection_name), "beforeConnection");

            UserDatabaseConnection connection = findOrCreateConnection(inputs);

            //if (log.isDebugEnabled()) displayDS((String)inputs.get(DataProcessor.input_key_database_connection_name), "beforeExecute");
            returnTO = executeKeepConnection(connection, inputs, processorType, processorName, outputFilters);
            //if (log.isDebugEnabled()) displayDS((String)inputs.get(DataProcessor.input_key_database_connection_name), "afterExecute");
View Full Code Here

        try {
            tm.beginTransactionImplicit();

            for (InputInfo ip : inputInfoList) {
                UserDatabaseConnection connection = findOrCreateConnection(ip);
                OmniDTO returnTO = executeKeepConnection(connection, ip.getInputs(), ip.getProcessorType(), ip.getProcessorName(), ip.getOutputFilters());
                returnTOList.add(returnTO);

                //now execute child InputInfo
                Collection<InputInfo> childList = ip.getChildInputInfoObjects();
View Full Code Here

        try {
            tm.beginTransactionImplicit();

            InputInfo ip = inputInfo;
            UserDatabaseConnection udc = findOrCreateConnection(ip);
            udc.getConnection().setReadOnly(true);

            returnTO = executeKeepConnection(udc, ip.getInputs(), ip.getProcessorType(), ip.getProcessorName(), ip.getOutputFilters());
            log.debug("parent: " + returnTO);

            //now execute child InputInfo
View Full Code Here

     *
     * @param inputs    Map of inputs
     * @return UserDatabaseConnection object
     */
    private UserDatabaseConnection findOrCreateConnection(Map<String, Object> inputs) {
      UserDatabaseConnection udc = null;
        DatabaseConnectionContext dcc =
            (DatabaseConnectionContext)inputs.get(DataProcessor.input_key_database_connection_context);
        String connectionName = (String)inputs.get(DataProcessor.input_key_database_connection_name);
        if (dcc != null && connectionName != null) {
            throw new IllegalArgumentException("You cannot have both connection name and dcc in the same inputs map.");
View Full Code Here

TOP

Related Classes of com.scooterframework.orm.sqldataexpress.connection.UserDatabaseConnection

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.