我正在学习 Hibernate,并使用 Eclipse Helios 作为 IDE、Oracle11g 作为数据库和 Glassfish 3 作为服务器来使用它。我正在关注一个简单的应用程序 (JSF+Spring+Hibernate)
我发现一个简单的选择和插入非常慢,选择查询几乎需要 25 秒。我想知道为什么它比普通的 JDBC 慢。
以下来自 server.log,当我刷新页面时,相同的查询执行了五次。这是慢的原因吗?
INFO: Hibernate: select customer0_.CUSTOMER_ID as CUSTOMER1_0_,
customer0_.NAME as NAME0_, customer0_.ADDRESS as ADDRESS0_, customer0_.
CREATED_DATE as CREATED4_0_ from scott.customer customer0_
INFO: Hibernate: select customer0_.CUSTOMER_ID as CUSTOMER1_0_,
customer0_.NAME as NAME0_, customer0_.ADDRESS as ADDRESS0_, customer0_.
CREATED_DATE as CREATED4_0_ from scott.customer customer0_
INFO: Hibernate: select customer0_.CUSTOMER_ID as CUSTOMER1_0_,
customer0_.NAME as NAME0_, customer0_.ADDRESS as ADDRESS0_, customer0_.
CREATED_DATE as CREATED4_0_ from scott.customer customer0_
INFO: Hibernate: select customer0_.CUSTOMER_ID as CUSTOMER1_0_,
customer0_.NAME as NAME0_, customer0_.ADDRESS as ADDRESS0_, customer0_.
CREATED_DATE as CREATED4_0_ from scott.customer customer0_
INFO: Hibernate: select customer0_.CUSTOMER_ID as CUSTOMER1_0_, customer0_.
NAME as NAME0_, customer0_.ADDRESS as ADDRESS0_, customer0_.
CREATED_DATE as CREATED4_0_ from scott.customer customer0_
任何见解或帮助都是非常可观的。