Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 4.11.x into 4.12.x #3358

Merged
merged 6 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
import io.micronaut.data.connection.ConnectionDefinition;
import io.micronaut.data.connection.ConnectionStatus;
import io.micronaut.data.connection.support.AbstractConnectionOperations;
import io.micronaut.data.mongodb.conf.RequiresSyncMongo;

@Internal
@RequiresSyncMongo
@EachBean(MongoClient.class)
@Internal
final class MongoConnectionOperationsImpl extends AbstractConnectionOperations<ClientSession> implements MongoConnectionOperations {

private final MongoClient mongoClient;
Expand All @@ -40,9 +42,6 @@ protected ClientSession openConnection(ConnectionDefinition definition) {

@Override
protected void setupConnection(ConnectionStatus<ClientSession> connectionStatus) {
// if (connectionStatus.getDefinition().isP) {
// throw new ConnectionException("MongoDB client doesn't support read only client session!");
// }
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import io.micronaut.inject.ast.ParameterElement;
import io.micronaut.inject.ast.TypedElement;
import io.micronaut.inject.processing.ProcessingException;
import io.micronaut.inject.visitor.ElementPostponedToNextRoundException;
import io.micronaut.inject.visitor.TypeElementVisitor;
import io.micronaut.inject.visitor.VisitorContext;

Expand Down Expand Up @@ -321,6 +322,11 @@ public void visitMethod(MethodElement element, VisitorContext context) {
context.fail(matchContext.getUnableToImplementMessage() + e.getMessage(), e.getElement() == null ? element : e.getElement());
this.failing = true;
} catch (Exception e) {
if (e instanceof ElementPostponedToNextRoundException || e.getClass().getSimpleName().equals("PostponeToNextRoundException")) {
// rethrow postponed and don't fail compilation
// this is not ideal since PostponeToNextRoundException is part of inject-java
throw e;
}
matchContext.fail(e.getMessage());
this.failing = true;
}
Expand Down
Loading