Examples of adaptorContext()


Examples of com.webobjects.eoaccess.EOAdaptorChannel.adaptorContext()

      boolean channelOpen = adaptorChannel.isOpen();
      if (!channelOpen) {
        adaptorChannel.openChannel();
      }
      try {
        JDBCContext jdbccontext = (JDBCContext) adaptorChannel.adaptorContext();
        try {
          jdbccontext.beginTransaction();
          Connection conn = jdbccontext.connection();
          Statement stmt = conn.createStatement();
          stmt.executeUpdate(sql);
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptorChannel.adaptorContext()

      boolean channelOpen = adaptorChannel.isOpen();
      if (!channelOpen) {
        adaptorChannel.openChannel();
      }
      try {
        JDBCContext jdbccontext = (JDBCContext) adaptorChannel.adaptorContext();
        try {
          jdbccontext.beginTransaction();
          Connection conn = jdbccontext.connection();
          Statement stmt = conn.createStatement();
          stmt.executeUpdate(sql);
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptorChannel.adaptorContext()

      EODatabaseContext dbc = EOUtilities.databaseContextForModelNamed(ec, eomodel.name());
      dbc.lock();
      try {
        EOAdaptorChannel channel = dbc.availableChannel().adaptorChannel();
        if (eomodel.adaptorName().contains("JDBC")) {
          EOSynchronizationFactory syncFactory = (EOSynchronizationFactory) channel.adaptorContext().adaptor().synchronizationFactory();
          ERXSQLHelper helper = ERXSQLHelper.newSQLHelper(channel);
          NSDictionary options = helper.defaultOptionDictionary(true, dropTables);

          // Primary key support creation throws an unwanted exception
          // if
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptorChannel.adaptorContext()

           
            if (!adaptorChannel.isOpen()) {
                adaptorChannel.openChannel();
            }

            EOSQLExpression expression = adaptorChannel.adaptorContext().adaptor().expressionFactory().expressionForString( query );

            String proceccedQuery = processedQueryString(query, expression, bindings);
            expression.setStatement(proceccedQuery);

            try {
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptorChannel.adaptorContext()

    public static NSArray rawRowsForSqlWithBindings( EOEditingContext ec, String entityName, String query, ERXSQLBinding... bindings ) {
        EODatabaseChannel databaseChannel = databaseContextForEntityName(ec,entityName).availableChannel();
        EOAdaptorChannel adaptorChannel = databaseChannel.adaptorChannel();
        EOEntity entity = EOUtilities.entityNamed(ec, entityName);

        EOSQLExpression expression = adaptorChannel.adaptorContext().adaptor().expressionFactory().expressionForEntity( entity );
        expression.setStatement( processedQueryString( query, expression, bindings ) );

        EOFetchSpecification spec = new EOFetchSpecification( entityName, null, null );
        spec.setFetchesRawRows(true);
        spec.setHints( new NSDictionary( expression, EODatabaseContext.CustomQueryExpressionHintKey ) );
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptorChannel.adaptorContext()

            context.lock();
            adaptorOperationsLock.lock();
            try {
                EODatabaseChannel dchannel = context.availableChannel();
                EOAdaptorChannel achannel = dchannel.adaptorChannel();
                achannel.adaptorContext().beginTransaction();
                boolean wasOpen = achannel.isOpen();
                if (!wasOpen) {
                    achannel.openChannel();
                }
                for(int i = 0; i < ops.count(); i++) {
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptorChannel.adaptorContext()

                    } catch(EOGeneralAdaptorException ex) {
                        log.error("Failed op " + i + ": " + ex + "\n" + op);
                        throw ex;
                    }
                }
                achannel.adaptorContext().commitTransaction();
                if (!wasOpen) {
                    achannel.closeChannel();
                }
            } finally {
                adaptorOperationsLock.unlock();
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptorChannel.adaptorContext()

                    channel = dbc.availableChannel().adaptorChannel();
                    wasOpen = channel.isOpen();
                    if(!wasOpen) {
                        channel.openChannel();
                    }
                    channel.adaptorContext().beginTransaction();
                    try {
                        rows = doPerform(channel);
                        channel.adaptorContext().commitTransaction();
                    } catch(RuntimeException ex) {
                        channel.adaptorContext().rollbackTransaction();
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptorChannel.adaptorContext()

                        channel.openChannel();
                    }
                    channel.adaptorContext().beginTransaction();
                    try {
                        rows = doPerform(channel);
                        channel.adaptorContext().commitTransaction();
                    } catch(RuntimeException ex) {
                        channel.adaptorContext().rollbackTransaction();
                        throw ex;
                    }
                } finally {
View Full Code Here

Examples of com.webobjects.eoaccess.EOAdaptorChannel.adaptorContext()

                    channel.adaptorContext().beginTransaction();
                    try {
                        rows = doPerform(channel);
                        channel.adaptorContext().commitTransaction();
                    } catch(RuntimeException ex) {
                        channel.adaptorContext().rollbackTransaction();
                        throw ex;
                    }
                } finally {
                    if (!wasOpen && channel != null) {
                        channel.closeChannel();
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.