Ibatis 和轮询数据库
我想使用 IBatis 轮询 3 个旧数据库中的新行并插入到新数据库中。但我们的客户不允许我在三个旧数据库中插入一个“状态”列,这有助于我避免消耗两次或更多。那我该怎么办?提前致谢!
I would like to use IBatis for polling 3 legacy databases for new rows and insert into a new database. But our customers don't allow me to insert one "status" column in three legacy databases which help me avoid consuming twice or more. So what do I have to do? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建一个包含状态列的新表,并添加一个指向旧表主键的外键。创建一个将两个表连接在一起的视图,您将拥有与旧表关联的状态列,而无需更改它。
Create a new table with the status column and add a foreign key pointing to the primary key of the legacy table. Create a view with both tables joined together and you will have your status column associated with the legacy table without altering it.
您可以使用幂等消费者EIP来过滤掉重复项
http://camel.apache.org/idempot-consumer.html
但正如 Joachim 所说,您需要一个新表来存储状态。
您也许还可以在原始表+状态表上创建一个SQL VIEW,并让iBatis 查询该视图。
You can use the idempotent consumer EIP to filter out duplicates
http://camel.apache.org/idempotent-consumer.html
But as Joachim said, you need a new table to store the status.
You can maybe also create a SQL VIEW on the original table + status table, and let iBatis query that view.