Package com.webobjects.eoaccess

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


    try {
      EODatabaseChannel databaseChannel = databaseContext.availableChannel();
      EOAdaptorChannel adaptorChannel = databaseChannel.adaptorChannel();
      boolean channelOpen = adaptorChannel.isOpen();
      if (!channelOpen) {
        adaptorChannel.openChannel();
      }
      try {
        JDBCContext jdbccontext = (JDBCContext) adaptorChannel.adaptorContext();
        try {
          jdbccontext.beginTransaction();
View Full Code Here


    try {
      EODatabaseChannel databaseChannel = databaseContext.availableChannel();
      EOAdaptorChannel adaptorChannel = databaseChannel.adaptorChannel();
      boolean channelOpen = adaptorChannel.isOpen();
      if (!channelOpen) {
        adaptorChannel.openChannel();
      }
      try {
        JDBCContext jdbccontext = (JDBCContext) adaptorChannel.adaptorContext();
        try {
          jdbccontext.beginTransaction();
View Full Code Here

        try {
            EOAdaptorChannel adaptorChannel = databaseChannel.adaptorChannel();
           
            if (!adaptorChannel.isOpen()) {
                adaptorChannel.openChannel();
            }

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

            String proceccedQuery = processedQueryString(query, expression, bindings);
View Full Code Here

        EOSQLExpression sqlExpr = sqlFactory.expressionForEntity(entity);
        sqlExpr.prepareSelectExpressionWithAttributes(new NSArray<EOAttribute>(aggregateAttribute), false, fetchSpec);

        EOAdaptorChannel adaptorChannel = databaseContext.availableChannel().adaptorChannel();
        if (!adaptorChannel.isOpen()) {
            adaptorChannel.openChannel();
        }
        Object aggregateValue = null;
        NSArray<EOAttribute> attributes = new NSArray<EOAttribute>(aggregateAttribute);
        adaptorChannel.evaluateExpression(sqlExpr);
        try {
View Full Code Here

            boolean willRetryAfterHandlingDroppedConnection = true;
            while (willRetryAfterHandlingDroppedConnection) {
              try {
                EOAdaptorChannel adaptorChannel = dbContext.availableChannel().adaptorChannel();
                if (!adaptorChannel.isOpen()) {
                    adaptorChannel.openChannel();
                }
                NSArray<NSDictionary<String, Object>> arr = adaptorChannel.primaryKeysForNewRowsWithEntity(1, entity);
                if (arr != null) {
                    primaryKey = arr.lastObject();
                } else {
View Full Code Here

                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++) {
                    op = (ERXAdaptorOperationWrapper)ops.objectAtIndex(i);
                    try {
                        achannel.performAdaptorOperation(op.operation());
View Full Code Here

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

        EODatabaseContext dbContext = EODatabaseContext.registeredDatabaseContextForModel(entity.model(), ec);
        dbContext.lock();
        try {
          EOAdaptorChannel adaptorChannel = dbContext.availableChannel().adaptorChannel();
          if (!adaptorChannel.isOpen()) {
            adaptorChannel.openChannel();
          }
          EOSQLExpressionFactory factory = adaptorChannel.adaptorContext().adaptor().expressionFactory();
      if (ERXEOAccessUtilities.log.isInfoEnabled()) {
        ERXEOAccessUtilities.log.info("Executing " + exp);
      }
View Full Code Here

    private static NSArray _rawRowsForSQLExpression(EODatabaseContext dbc, EOSQLExpression expression, NSArray<EOAttribute> attributes) {
        NSMutableArray results = null;
        EOAdaptorChannel channel = dbc.availableChannel().adaptorChannel();
       
        if (!channel.isOpen())
            channel.openChannel();
        // If channel.evaluateExpression throws when committing, it won't close the JDBC transaction
        // Probably a bug in JDBCChannel, but we must take care of it
        boolean contextHadOpenTransaction = channel.adaptorContext().hasOpenTransaction();
    try {
      channel.evaluateExpression(expression);      
View Full Code Here

      NSDictionary primaryKey = null;
      dbContext.lock();
      try {
        EOAdaptorChannel adaptorChannel = dbContext.availableChannel().adaptorChannel();
        if (!adaptorChannel.isOpen()) {
          adaptorChannel.openChannel();
        }
        NSArray arr = adaptorChannel.primaryKeysForNewRowsWithEntity(1, entity);
        if (arr != null) {
          primaryKey = (NSDictionary) arr.lastObject();
        } else {
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.