Jdbc 使用历史策略或DescriptorReventAdapter时禁用eclipselink批写入

Jdbc 使用历史策略或DescriptorReventAdapter时禁用eclipselink批写入,jdbc,eclipselink,history,Jdbc,Eclipselink,History,我尝试使用eclipselink历史策略来记录一个表/实体的更改历史。我还使用DescriptorReventAdapter/aboutToInsert、aboutToUpdate、aboutToDelete钩子插入审计记录。除了在应用上述功能后发现批处理写入选项不起作用之外,所有的事情都很好 <property name="eclipselink.jdbc.batch-writing" value="JDBC" /> 应用历史记录/描述符ReventAdapter后 DEBUG

我尝试使用eclipselink历史策略来记录一个表/实体的更改历史。我还使用DescriptorReventAdapter/aboutToInsert、aboutToUpdate、aboutToDelete钩子插入审计记录。除了在应用上述功能后发现批处理写入选项不起作用之外,所有的事情都很好

<property name="eclipselink.jdbc.batch-writing" value="JDBC" />
应用历史记录/描述符ReventAdapter后

DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY (ID, NAME) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [1, insert-0]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY_HIST (ID, NAME, VALID_FROM) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [1, insert-0, 2016-06-16 01:55:22.424]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY (ID, NAME) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [2, insert-1]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY_HIST (ID, NAME, VALID_FROM) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [2, insert-1, 2016-06-16 01:55:22.424]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY (ID, NAME) VALUES (?, ?) 
DEBUG o.e.p.s./.sql -   bind => [3, insert-3]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY_HIST (ID, NAME, VALID_FROM) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [3, insert-3, 2016-06-16 01:55:22.424]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY (ID, NAME) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [4, insert-3]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY_HIST (ID, NAME, VALID_FROM) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [4, insert-3, 2016-06-16 01:55:22.424]

你能给我一些建议吗?提前感谢。

EclipseLink似乎会立即刷新实体插入,以便随后发布历史插入。您需要在EclipseLink中提交bug/feature请求,以便它能够更有效地捆绑这些bug/feature请求,从而利用批处理编写的优势。谢谢Chris。我提出了一个错误。但没有人对此作出答复。
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY (ID, NAME) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [1, insert-0]
DEBUG o.e.p.s./.sql -   bind => [2, insert-1] 
DEBUG o.e.p.s./.sql -   bind => [3, insert-2]
DEBUG o.e.p.s./.sql -   bind => [4, insert-3]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY (ID, NAME) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [1, insert-0]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY_HIST (ID, NAME, VALID_FROM) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [1, insert-0, 2016-06-16 01:55:22.424]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY (ID, NAME) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [2, insert-1]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY_HIST (ID, NAME, VALID_FROM) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [2, insert-1, 2016-06-16 01:55:22.424]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY (ID, NAME) VALUES (?, ?) 
DEBUG o.e.p.s./.sql -   bind => [3, insert-3]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY_HIST (ID, NAME, VALID_FROM) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [3, insert-3, 2016-06-16 01:55:22.424]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY (ID, NAME) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [4, insert-3]
DEBUG o.e.p.s./.sql - INSERT INTO MY_ENTITY_HIST (ID, NAME, VALID_FROM) VALUES (?, ?)
DEBUG o.e.p.s./.sql -   bind => [4, insert-3, 2016-06-16 01:55:22.424]