- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有一个在 Windows 服务器上运行的 Java 应用程序。此应用程序通过 Hibernate 查询 Oracle 10 数据库。我有一个查询返回 215 个实体的集合,每个实体有 6 个字符串字段。大约需要 20 秒才能恢复(从 hibernate 状态中获取的状态)
我取回了由 hibernate 生成的 sql 并通过 SQLPlus 运行它,运行时间在 300-500 毫秒之间。
我使用 ojdbc 驱动程序启动 H2 控制台(与我的应用程序使用的相同)并连接到我的数据库(从与我的应用程序运行相同的计算机以避免网络问题),多次运行我从 Hibernate 获得的 sql,我得到了与 SQLPlus 相同的 300-500 毫秒运行时间,所以我猜我的问题来自 Hibernate,但我不知道该去哪里找了。
数据库在另一台服务器上,但我收到 <1 毫秒的 ping 到该服务器,所以我认为不涉及网络。
我的配置:
javax.persistence.jdbc.driver=oracle.jdbc.driver.OracleDriver
javax.persistence.jdbc.url=jdbc:oracle:thin:@xxxxx
javax.persistence.jdbc.user=xxxxx
javax.persistence.jdbc.password=xxxxx
hibernate.ejb.naming_strategy=org.nuiton.jpa.hibernate.OracleCompliantImprovedNamingStrategy
hibernate.dialect=xxxx.MyDialect
hibernate.hbm2ddl.auto=update
hibernate.show_sql=false
hibernate.use_sql_comments=false
hibernate.format_sql=true
hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
hibernate.c3p0.min_size=3
hibernate.c3p0.max_size=5
hibernate.c3p0.timeout=1800
hibernate.c3p0.max_statements=50
hibernate.generate_statistics = false
方言:
public class MyDialect extends Oracle10gDialect {
public MyDialect() {
super();
registerColumnType(Types.DOUBLE, "number");
}
}
我的实体看起来像(带有 getter 和 setter):
public abstract class AbstractJpaRequestedArticle extends AbstractJpaEntity implements Serializable {
private static final long serialVersionUID = 7293079560062973232L;
public static final String PROPERTY_ID = "id";
public static final String PROPERTY_QUANTITY = "quantity";
public static final String PROPERTY_PRIORITY = "priority";
public static final String PROPERTY_ARTICLE = "article";
public static final String PROPERTY_REQUESTED_LIST = "requestedList";
public static final String PROPERTY_DESTINATION_LOCATION = "destinationLocation";
@Id
protected String id;
protected double quantity;
protected String priority;
@ManyToOne
protected Article article;
@OneToOne
protected RequestedList requestedList;
@ManyToOne
protected Location destinationLocation;
@PrePersist
public void prePersist() {
if (this.id == null) {
this.id = new JpaEntityIdFactoryResolver().newId(this);
}
}
@Override
public String getId() {
return id;
}
AbstractJpaEntity 只定义了equals、hashcode 和默认的toString
最佳答案
回到我的问题,提供我长期寻找的答案。
正如@AmitNaik 所指出的,我的问题来自未设置的获取大小,因此使用了默认大小 (10)。我试图在 hibernate 参数中设置不同的值,但没有成功。看来在我的 Hibernate 版本中,我的 entityManagerFactory 中没有考虑该参数(为什么?)。所以我必须在我的特定查询上设置获取大小,这解决了我的问题(我现在在我的测试用例中大约 600 毫秒)。正如 @john16384 所说,我现在必须调查我的 SQL 查询,但那是另一回事了。
关于java - 是什么减慢了 Hibernate/Oracle 的速度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56356606/
我正在使用 UISnapBehavior,但它的捕捉速度太快了,我不喜欢。有没有办法让它慢下来?或者换句话说:有没有办法用它应该捕捉的点来调整物体的弹性? 最佳答案 我能够通过将 View 附加到 U
我想减慢 SWTBot 的执行速度。 我已经找到了这个 wiki: https://wiki.eclipse.org/SWTBot/FAQ#Can_I_slow_down_the_execution_
我的应用程序中有一个计时错误,只有在我使用 valgrind 时才会发生,因为 valgrind 会大大减慢进程的速度。 (它实际上是一个我无法本地化的 boost::weak_ptr-excepti
问题 我正在创建一个涉及躲避射弹的游戏。玩家控制着一艘船的图像,我不希望船完全一起移动,因为这看起来非常不现实。 问题 有没有办法控制图像移动的速度,如何减慢图像的移动速度? 代码 var game
我在我的 iOS 应用程序中使用了 NSTimer,但由于 SetNeedsDisplay,我没有得到我想要的结果。 我做了一些研究并找到了 CADisplayLink,它为我提供了我想要的动画结果。
我目前正在开发一个项目,当按下按钮时,该项目会将圆从一个空间移动到另一个空间。我的设计如下:当按下按钮时,它会在 for 循环中从 0 到 10 增加圆的坐标。 问题是,我想要的 for 循环运动没有
我想缓慢地制作一个三色渐变动画。 我有一个自定义UIView,如下所示: class MyView: UIView, CAAnimationDelegate { lazy var gradient
当 RAM 达到 x 内存量或调用 didReceiveMemoryWarning() 时,是否有办法减慢处理器速度? func didReceiveMemoryWarning() { sup
有没有办法减慢行插入/删除动画的速度? 在我的特殊情况下,我通过在我的单元格下方添加/删除行来扩展/折叠单元格,我想稍微放慢动画速度。 最佳答案 我正在使用以下技巧在我的项目中以动画方式插入/删除表格
我的 Logo 和页脚中有 scroll-top 属性,但我离页面顶部越远,它向上滚动的速度就越快!所以当我从页面底部滚动到顶部时,它就像火箭一样!我将如何放慢速度?我找不到足够具体的答案 可以看看l
我想放慢由我的 UIDynamicAnimator 生成的动画,以便我可以微调我的 UIDynamicBehaviors。 在 ios 模拟器中,调试菜单下有一个菜单选项,标签为“在最前面的应用程序中
在 OS X 上,可以按住 Shift 键使动画变慢。有什么方法可以通过远程调试器或 Instruments 将其应用于 iOS 吗? (或者,我可以在 QuickTime 中录制并逐帧回放,但我宁愿
我想在 .opacity CSS 属性中减慢动画时间。就像,我希望它延迟 0.2 毫秒或类似的东西。 为了获得更好的想法,将鼠标悬停在我网站上的精选帖子上时会添加不透明度:http://www.the
我希望我的 UIPageViewController 在用户的手指离开屏幕时缓慢滚动到下一页。比默认情况下慢。如果可能的话,对其减速曲线等进行更多控制。 我不想使用 SCPageViewControl
我发现了这个 javascript 自动滚动函数,并通过将其粘贴到 WordPress 站点的头文件中来使其工作。但是,我想减慢滚动速度,以便它不会立即捕捉到页面底部。 我是 javascript 的
我正在使用 UIScrollView 以编程方式为某些内容设置动画。 但是,我需要减慢 View 的滚动速度。 这是我用于滚动的代码: self.scrollView.setContentOffset
我一直在使用 jQuery 滚动来增强我的视差滚动页面。具体来说就是这个。 JQuery Scroll to Next Section 我对 jQuery 完全陌生(过去只使用过一些相当基本的 Jav
如何减慢 Windows 进程? 我知道我需要 Hook QueryPerformanceCounter 但接下来我需要做什么? 需要 Delphi 或 C++ 方面的帮助 最佳答案 我不确定我是否理
我想在我这边控制下载量/速度——在服务器端也一样(礼貌一点)。...不是“我自己的下载管理器”。 让我们想象一下:我允许我的儿子每天从 utube 下载最多 500Mb,但他仍然启动了一个 sessi
在我的网站上,我有多个 href's,我需要在点击它们和加载它们之间添加延迟。由于有数百个 hrefs,我不能为每个单独的 js 函数。 我研究过的两种方法是,将 href 的内容作为变量传递给 ja
我是一名优秀的程序员,十分优秀!