---
title: "Spring2.0还是EJB3.0"
author: "oak2008"
date: "2007-10-12T12:55:30Z"
tags: []
slug: "spring2-0-ejb3-0"
draft: false
lastmod: "2007-10-12T12:55:30Z"
id: 131337
url: "https://oak2008.iteye.com/blog/131337"
---

今天做了一个关于Spring2.0和EJB3.0的测试（Spring设置了c3p0缓冲池--提高效率）
我用的是Mysql,数据库里面约有十万记录．
从这么多记录里找一条记录,Spring2.0+hibernate3.2用的时间平均是4000ms
ejb3.0用的平均时间是600ms！

从这次测试，暴露了Spring+hibernate的一个弱点：对付数据库量很大的时候，
Spring+hibernate的速度很难让人接受．

另外，以前测试过，Spring+hibernate处理2万记录，速度还是很快的，时间大约2000ms,今天测试十万记录，这个速度没办法跟ejb3.0比...