轻量级的高性能批插框架 liteBatch

码农软件 · 软件分类 · 其他开发相关 · 2019-10-16 19:14:23

软件介绍

liteBatch 是一个轻量级,高性能,高通用的批插框架。

  • 能够像普通 insert 一样在循环中插入 PO

  • 支持数据库和文件批插2种模式

  • 异步执行,无阻塞

  • 可以和各种 ORM 结合使用

  • 提供对 spring 的支持

  • 兼容各种数据库

  • 适应所有的 VO ,自动生成脚本

  • 性能高效,测试机上测试大概4w+/秒

  • 自动处理各种基础类型的数据

  • 支持自定义的映射和过滤字段

Quick Start

也可以参考 test 工程的 testUnit

	try {
		Random random = new Random();
		Person person = null;
		for (int i = 0; i < 100300; i++) {
			person = new Person();
			person.setAge(random.nextInt(100));
			person.setAddress("XX马路"+random.nextInt(100)+"号");
			person.setCompany("天天 向上科技有限公司");
			person.setName("张三");
			person.setCreateTime(new Date());
			rowBatchListener.insertOneWithBatch(person);
		}
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		rowBatchListener.flush();
	}
	<bean id="rowBatchListener"  class="com.thebeastshop.batch.spring.RowBatchListenerFactoryBean">
		<property name="jdbcTemplate" ref="jdbcTemplate"/>
		<property name="submitCapacity" value="5000"/>
		<property name="beanClass" value="com.thebeastshop.batch.test.Person"/>
		<!--<property name="syn" value="true"/>默认为false,推荐采用false,打开的话,则为同步模式-->
	</bean>

注意

在mysql数据库下,需要注意以下几点

  • 驱动包一定得5.1.13版本以上(含)

  • 在jdbc连接url里得加上rewriteBatchedStatements=true参数

本文地址:https://codercto.com/soft/d/16905.html

Introduction to the Design and Analysis of Algorithms

Introduction to the Design and Analysis of Algorithms

Anany Levitin / Addison Wesley / 2006-2-24 / USD 122.00

Based on a Based on a new classification of algorithm design techniques and a clear delineation of analysis methods, "Introduction to the Design and Analysis of Algorithms" presents the subject in a c......一起来看看 《Introduction to the Design and Analysis of Algorithms》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

SHA 加密
SHA 加密

SHA 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器