简体   繁体   English

对象化事务抛出IllegalStateException

[英]Objectify transaction throws IllegalStateException

/!\\ Sorry for this question. /!\\很抱歉这个问题。 In fact, my error is to get an object after done getTxn().commit() :( /!\\ 实际上,我的错误是在完成getTxn()。commit()之后获取对象:(/!\\

I'm a beginner with Objectify and GAE. 我是Objectify和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. java.lang.IllegalStateException:与该操作关联的事务未激活。

I use Objectify 3.1 and I have a class like this : 我使用Objectify 3.1,并且有一个像这样的类:

@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. 调用filter(“ m_foo =”,foo)时,始终抛出上述异常。

Many thanks for your help. 非常感谢您的帮助。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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