Cool! This just happens to be an example of what I'm writing about in my book as we speak. Now that I understand your problem, I think I can suggest a solution.
What you want to do is to force the "local transaction" that happens outside of the UserTransaction to complete BEFORE you begin the UserTransaction, right? You see, the problem is that it hasn't, so that's why things blow up for you. I believe (I'd have to try this to be sure, but this sure sounds like a good
test to try!) that you could solve your problem in the following way:
(1) Create a "Worker" Session bean that your MDB calls to do the work. It just has to have a Local Interface, no need for a Remote Interface.
(2) Have the "Pre User Transaction" work done all in one method of the "Worker Session". Let's call that "doEarlyWork()"
(3) Put all the rest of the work in another method of the "Worker Session". Call that "doLaterWork()".
Now let's talk about settings. For the MDB, I think that either "Bean Managed" or "Supports" would work for the transaction setting. For the "Worker Session", though, you need to set the "doLaterWork()" to "Bean Managed", as you have now, but you can set the "doEarlyWork()" method to (I think) either "Supports" or "Bean MAnaged".
Finally, on the "Worker" bean, set the "Local Transactions 2.0" settings to:
Boundary: Bean Method
Resolver: ContainerAtBoundary
UnresolverAction: Commit.
What that should do is to force the Local transaction started in "doEarlyWork" to commit properly before the UserTransaction is started.
If I get a moment, I'll try this on my own, but I'm reasonably sure this should work. If my test doesn't work out, I'll post a corrected version. Likewise, if this doesnt' work for you, I hope you'll post what happens!
Kyle