use of javax.resource.ResourceException in project Payara by payara.
the class NoTxConnectorAllocator method createResource.
public ResourceHandle createResource() throws PoolingException {
try {
ManagedConnection mc = mcf.createManagedConnection(subject, reqInfo);
ResourceHandle resource = createResourceHandle(mc, spec, this, info);
ConnectionEventListener l = new ConnectionListenerImpl(resource);
mc.addConnectionEventListener(l);
return resource;
} catch (ResourceException ex) {
Object[] params = new Object[] { spec.getPoolInfo(), ex.toString() };
_logger.log(Level.WARNING, "poolmgr.create_resource_error", params);
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Resource Exception while creating resource", ex);
}
if (ex.getLinkedException() != null) {
_logger.log(Level.WARNING, "poolmgr.create_resource_linked_error", ex.getLinkedException().toString());
}
throw new PoolingException(ex);
}
}
use of javax.resource.ResourceException in project Payara by payara.
the class AbstractConnectorAllocator method isConnectionValid.
public boolean isConnectionValid(ResourceHandle h) {
HashSet conn = new HashSet();
conn.add(h.getResource());
Set invalids = null;
try {
invalids = getInvalidConnections(conn);
} catch (ResourceException re) {
// ignore and continue??
// there's nothing the container can do but log it.
Object[] args = new Object[] { h.getResourceSpec().getPoolInfo(), re.getClass(), re.getMessage() };
_logger.log(Level.WARNING, "pool.get_invalid_connections_resourceexception", args);
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "", re);
}
}
if ((invalids != null && invalids.size() > 0) || h.hasConnectionErrorOccurred()) {
return false;
}
return true;
}
use of javax.resource.ResourceException in project Payara by payara.
the class AbstractConnectorAllocator method closeUserConnection.
public void closeUserConnection(ResourceHandle resource) throws PoolingException {
try {
ManagedConnection mc = (ManagedConnection) resource.getResource();
mc.cleanup();
} catch (ResourceException ex) {
throw new PoolingException(ex);
}
}
use of javax.resource.ResourceException in project teiid by teiid.
the class CouchbaseProcedureExecution method execute.
@Override
public void execute() throws TranslatorException {
this.visitor = this.executionFactory.getN1QLVisitor();
this.visitor.append(call);
String n1ql = this.visitor.toString();
LogManager.logDetail(LogConstants.CTX_CONNECTOR, CouchbasePlugin.Util.gs(CouchbasePlugin.Event.TEIID29002, call, n1ql));
executionContext.logCommand(n1ql);
N1qlQueryResult queryResult;
try {
queryResult = connection.execute(n1ql);
} catch (ResourceException e) {
throw new TranslatorException(e);
}
this.results = queryResult.iterator();
}
use of javax.resource.ResourceException in project teiid by teiid.
the class CouchbaseQueryExecution method execute.
@Override
public void execute() throws TranslatorException {
this.visitor = this.executionFactory.getN1QLVisitor();
this.visitor.append(this.command);
String n1ql = this.visitor.toString();
LogManager.logDetail(LogConstants.CTX_CONNECTOR, CouchbasePlugin.Util.gs(CouchbasePlugin.Event.TEIID29001, n1ql));
executionContext.logCommand(n1ql);
N1qlQueryResult queryResult;
try {
queryResult = connection.execute(n1ql);
} catch (ResourceException e) {
throw new TranslatorException(e);
}
this.results = queryResult.iterator();
}
Aggregations