首页 \ 问答 \ Spring批量框架(Spring Batch Framework)

Spring批量框架(Spring Batch Framework)

我无法确定Spring Batch框架是否适用于以下要求。 我需要专家对此提出意见。

以下是我的要求:

读取多个Oracle表(至少10个表,包括事务和主表),根据业务规则进行复杂计算,在事务表中插入/更新/删除记录。

我确定了以下两种设计:

设计#1:

ItemReader:从密钥事务表中选择符合条件的记录。

ItemProcessor:使用ItemReader检索的记录中的可用密钥从DB获取其他详细信息。(这将需要多次DB事务)执行验证和计算,并将要写入DB的详细信息作为列表中的对象添加。

ItemWriter:使用CustomItemWriter(插入/更新/删除操作)编写对象中可用的详细信息

通过这种设计,我们可以实现并行处理,但增加了DB事务的数量。

设计#2:

步骤1

ItemReader:使用Composite Item Reader(ItemReaders组)读取所有必需的表。

ItemWriter:将结果集保存为执行上下文中的对象列表(每个表一个列表)

第2步

ItemReader:检索执行上下文中可用的对象列表,并根据业务处理将它们分组到一个对象列表中,以便处理器可以处理它们。

IremProcessor:处理ItemReader返回的对象块。 进行验证和计算,并将要写入DB的详细信息添加为列表中的对象。

ItemWriter:使用CustomItemWriter(插入/更新/删除操作)编写对象中可用的详细信息

通过这种设计,我们可以减少数据库事务的数量,但是我们正在延迟处理,直到检索到所有表记录并将其存储在执行上下文中,即我们没有使用SpringBatch提供的并行处理

请使用SpringBatch建议上述是否可行,或者我们需要使用传统的Java程序。


I am not able to finalize whether Spring Batch framework is applicable for the below requirement. I need experts inputs on this.

Following is my requirement:

Read multiple Oracle tables (at least 10 tables including both transaction and master), do complex calculation based on the business rules, Insert / Update / Delete records in transaction tables.

I have identified the following two designs:

Design # 1:

ItemReader: Select eligible records from Key transaction table.

ItemProcessor: Fetch additional details from DB using the key available in the record retrieved by ItemReader.(It would require multipble DB transactions) Do the validation and computation and add the details to be written to DB as objects in a list.

ItemWriter: Write the details available in objects using CustomItemWriter(insert / update / delete operation)

With this design, we can achieve parallel processing but increase the number of DB transactions.

Design # 2:

Step # 1

ItemReader: Use Composite Item Reader (Group of ItemReaders) to read all the required tables.

ItemWriter: Save the result sets as lists of Objects (One list per table) in execution context

Step # 2

ItemReader: Retrieve lists of Objects available in execution context and group them into one list of objects based on the business processing so that processor can process them.

IremProcessor: Process the chunk of Objects returned by ItemReader. Do the validation and computation and add the details to be written to DB as objects in a list.

ItemWriter: Write the details available in objects using CustomItemWriter(insert / update / delete operation)

With this design, we can REDUCE the number of DB Transactions but we are delaying the processing till all table records are retrieved and stored in execution context ie we are not using parallel processing provided by SpringBatch.

Please advise whether the above is feasible using SpringBatch or we need to use conventional Java program.


原文:https://stackoverflow.com/questions/27877802
更新时间:2023-02-01 13:02

最满意答案

命名空间和程序集是不同的东西。 特别是名称空间可以在程序集之间共享。

在这种情况下, SqlServerValueGenerationStrategy枚举确实包含在Microsoft.EntityFrameworkCore.Metadata 命名空间中 ,但正如您从链接中看到的那样,在Microsoft.EntityFrameworkCore.SqlServer.dll 程序集中定义。


Namespaces and assemblies are different things. In particular namespaces can be shared between assemblies.

In this case, the SqlServerValueGenerationStrategy enum is indeed contained in the Microsoft.EntityFrameworkCore.Metadata namespace, but as you can see from the link, is defined in Microsoft.EntityFrameworkCore.SqlServer.dll assembly.

相关问答

更多

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。