关于瞬态场

发布于 2025-01-05 02:17:07 字数 82 浏览 1 评论 0原文

我有一个类,它在该类中实现了持久性和瞬态布尔成员。我注意到,认为他的变量被声明为瞬态,但它的状态正在被持久化。我该如何解决这个问题。请帮忙。提前致谢。

I have a class which implements persistable and a transient boolean member in this class. I noticed that thought he variable is declared as transient its state is being persisted. How do i over come this issue. Kindly help. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘虞初梦 2025-01-12 02:17:07

Blackberry 的持久性机制不考虑瞬态。可能的解决方案是:

  • 将对象分成两部分,可持久化和不可持久化,或者
  • 使用不同的对象格式(可能是像 Hashtable 这样通用的东西)仅用于持久化,然后复制到“真实”对象中被加载,然后写回到虚拟对象中进行保存。

(请参阅此论坛帖子

Blackberry's persistence mechanism does not respect transient. Possible solutions are:

  • split the object into two parts, persistable and not, or
  • use a different object format (perhaps something generic like a Hashtable) only for persistance, copying out into the "real" object after it is loaded and then writing back into the dummy object for saving.

(See this forum thread)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文