Let's go with the messy but most efficient variant, then (SessionImpl implements CTC). regionFactory.startingTransaction( this ) would likely allocate even heavier object.
I'm not sure that the thing returned from #regionFactory.startingTransaction would "be heavier". That would obviously depend on each RegionFactory impl. However keep in mind that there would also only ever be one such allocation per Session, where in the other approaches ("Session implements CTC", e.g.) we'd have an allocation per txn boundary. Not that I anticipate that being a big deal, just pointing out that while the initial allocation may in fact be heavier (again this is not certain) we'd have less allocations. TBH, this is the direction I am leaning. It addresses both of our concerns.
Names: you know the pros and cons. If you just want to make qualified/unqualified more syntactically verbose while keeping strings, you could use Type Annotations, similar to @Tainted and @Untainted.
I'll give this some more thought. While I do like the intention of @Tainted and @Untainted, I'm not sure I like this not being enforced as it would with a specific arg type. The extra allocations should not be an issue based on what would actually have to generate them; in normal calls to the cache we would never have to because those would route through the CachedDomainDataAccess, etc |