简体   繁体   中英

Objectify transaction throws IllegalStateException

/!\\ Sorry for this question. In fact, my error is to get an object after done getTxn().commit() :( /!\\

I'm a beginner with Objectify and GAE. I dont understand why during a transaction I have this exception :

java.lang.IllegalStateException: Transaction with which this operation is associated is not active.

I use Objectify 3.1 and I have a class like this :

@Entity
public class A {
   @Id
   public Long m_id;

   @Parent
   public Key<B> m_key;

   public int m_foo;
}

I do this to get my object :

Key<B> key = new Key<B>(B.class, bId);
Query<A> query = ObjectifyService.beginTransaction().query(A.class).ancestor(key).<a class="ktg6us78hf8vdu7" href="#">filter</a>("m_foo =", foo);
return query.list().get(0);

When filter("m_foo =", foo) is called that always throws the exception above.

Many thanks for your help.

您始终可以在以下位置的“对象分组”列表中询问此问题: https ://groups.google.com/forum/?fromgroups#!forum/objectify-appengine

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM