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