诊断EclipseLink连接延迟? [英] Diagnosing an EclipseLink connection delay?

查看:94
本文介绍了诊断EclipseLink连接延迟?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用GlassFish 3.1.2服务器,并且我的Web应用程序使用EclipseLink 3.1.2作为JPA提供程序。 GlassFish在本地运行,MySQL服务器位于远程。

I am using a GlassFish 3.1.2 server and my web application uses EclipseLink 3.1.2 as a JPA provider. GlassFish is running locally, the MySQL server is remote.

问题是,当我启动服务器时,服务器挂起了很长时间,最后一行如下

The problem is that when I start my server the server hangs for a long time, with the following line as the last thing in the log.

[#|2012-03-26T14:37:31.765-0700|INFO|glassfish3.1.2|org.eclipse.persistence.session.file:/Users/alan/NetBeansProjects/MyApp/target/MyApp/WEB-INF/classes/_com.myapp|_ThreadID=10;_ThreadName=Thread-3;|EclipseLink, version: Eclipse Persistence Services - 2.3.2.v20111125-r10461|#]

在这里等待2-3分钟后,它通常会继续,然后像正常情况一样起作用。我的Web应用程序以我期望的方式与数据库一起工作。

After waiting here for 2-3 minutes, it will typically continue and then act as everything is normal. My web-app works with the data base the way I would expect.

如果NetBeans尝试启动服务器,则通常会超时,以为启动失败。 。如果我使用 asadmin 命令启动域,则花费相同的时间但成功了。

If NetBeans tries to start the server it will most often time-out, thinking that the start failed. If I start the domain with the asadmin command, it takes the same amount of time but it succeeds.

我家里有一个相同的系统

I have an identical system at home that connects to the same MySQL server that does not do this.

那么我如何告诉EclipseLink告诉我更多有关它在等待什么的信息?

So how do I tell EclipseLink to tell me more about what it is waiting for?

更新:

这是我的persistence.xml文件-没什么特别的。

Here is my persistence.xml file -- nothing remarkable. Are there EclipseLink-specific commands that could be used to help?

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="com.myapp" transaction-type="JTA">
    <jta-data-source>jdbc/MyApp</jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
</persistence-unit>

推荐答案

如果在Windows上运行kill或ctrl break,则Java应该转储当前线程,这样您就可以看到它正在等待什么。或在调试器中暂停线程。

If you run kill or ctrl break on windows, Java should dumps the current threads, so you can see what it is waiting on. Or pause the thread in a debugger.

包括您的persistence.xml。检查连接池的大小,以及网络是否可以正确访问数据库。您的jar文件中有几类?您是否尝试过禁用编织或列出课程?

Include your persistence.xml. Check the size of your connection pool, and if your network can access your database properly. How many classes are in your jar file? Have you tried disabling weaving or listing the classes?

这篇关于诊断EclipseLink连接延迟?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆