在使用sequleize更新较大的哈希值时弹出一个奇怪的问题。 我有一个哈希值
org.hibernate.AssertionFailure: null id in EntityA entry (don't flush the Session after an exception occurs)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:60)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:175)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:135)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:216)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:85)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1282)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1300)
,并使用以下命令更新我的表的哈希属性:
value='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijk0NDY5YWY1MjdkM2RlZjBkZGMxYTRlYWU1MjdmZWQ0IiwiaWF0IjoxNTQyMTgxMzkwLCJleHAiOjE1NDIxOTIxOTB9.SxShzkA_j3wSprlt8bHwJwzxirQ-'
并且日志中的结果是
TempUser.update( {hash:hash}, { where: { user: req.body.TempUser.user } } );
我不知道为什么会这样。
我也在github中提出了这个问题。不要为什么它反复关闭。 https://github.com/sequelize/sequelize/issues/10161