[英]Cannot modify a bean of type User that is in a readonly bundle
I've added a new field to user.etx
called LastLoggedIn_Ext
.我在
user.etx
添加了一个名为LastLoggedIn_Ext
的新字段。 But getting an error when trying to write to it:但是在尝试写入时出现错误:
Cannot modify a bean of type User that is in a readonly bundle
无法修改只读包中的 User 类型的 bean
My code:我的代码:
user.Ext_LastLoggedIn = Date.Now
Is there a way to bypass read only bundle so that I can save the time the user last logged into PolicyCenter in the user.etx table?有没有办法绕过只读包,以便我可以在 user.etx 表中保存用户上次登录 PolicyCenter 的时间?
You have to add it to writable bundle, for example例如,您必须将其添加到可写包中
gw.transaction.Transaction.runWithNewBundle(\bundle -> {
var writableUser = bundle.add(user)
writableUser.Ext_LastLoggedIn = Date.Now
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.