playframework/playframework — pull request #2042 by jroper (2014-08-25 08:32:01+00:00)
Title: [2.2.1-java] impossible to use promise with withTransaction into @Transactional controllers

Example: https://github.com/zadonskiyd/play2jpaProblemExample

```java
F.Promise helloPromise = promise(new F.Function0() {
@Override
public String apply() throws Throwable {
return JPA.withTransaction(new F.Function0() {
@Override
public String apply() throws Throwable {
return "hello";
}
});
}
});
String hello = helloPromise.get(1000);
```
removes em from current thread ?
```
[RuntimeException: No EntityManager bound to this thread.
Try to annotate your action method with @play.db.jpa.Transactional]
```
at
```
84 Long total = (Long)JPA.em()
```

In 2.1.0 same code (with Akka.future instead of promise) works fine