File tree 1 file changed +9
-8
lines changed
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -349,14 +349,15 @@ public boolean isInjectable() {
349
349
350
350
@ Override
351
351
public String scope () {
352
- if (jakartaDataRepository ) {
353
- return context .addTransactionScopedAnnotation ()
354
- ? "jakarta.transaction.TransactionScoped"
355
- : "jakarta.enterprise.context.RequestScoped" ;
356
- }
357
- else {
358
- return "jakarta.enterprise.context.Dependent" ;
359
- }
352
+ // @TransactionScoped doesn't work here because repositories
353
+ // are supposed to be able to demarcate transactions, which
354
+ // means they should be injectable when there is no active tx
355
+ // @RequestScoped doesn't work because Arc folks think this
356
+ // scope should only be active during a HTTP request, which
357
+ // is simply wrong according to me, but whatever
358
+ // @ApplicationScoped could work in principle, but buys us
359
+ // nothing additional, since repositories are stateless
360
+ return "jakarta.enterprise.context.Dependent" ;
360
361
}
361
362
362
363
@ Override
You can’t perform that action at this time.
0 commit comments