EntiyManager CreateQuery挂起 [英] EntiyManager CreateQuery Hangs

查看:125
本文介绍了EntiyManager CreateQuery挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用EclipseLink为持久层创建一个Web应用程序,并且当我尝试加载对象时,有一个DAO挂起.

I am creating a webapp with EclipseLink for the persistence layer, and I have a DAO that is hanging when I attempt to load an object.

该应用程序/代码以前在加载到其他机器/IDE中时已经起作用,但是我刚刚将其加载到Windows 7机器上的Eclipse Indigo中,并且此错误已开始发生(代码中没有编译错误/警告.等等,该应用程序可以正常构建/启动.)

The application/code has previously worked when loaded in to other machines/IDEs, but I have just loaded it into Eclipse Indigo on a Windows 7 machine and this error has started occuring (there are no compile errors/warnings in the code etc, and the app builds/starts fine).

DAO方法如下:

public Account loadAccountByUserName(String userName)
{
        Query query = getEntityManager().createQuery("select u from Account u where u.userName = :userName")
                .setParameter("userName", userName);

        return (Account) query.getSingleResult();

现在,我已经调试了代码,并遍历了代码,一旦执行createQuery(..)行,它就会挂起.没有错误,没有任何记录,它只是挂起(显然是无限期地挂起).

Now I have debugged the code, and walked through it, and once I execute the createQuery(..) line it just hangs. There are no errors, nothing logged, it just hangs (apparently indefinitely).

有什么想法吗?

推荐答案

哇,好的.只是挺慢..

Wow, Ok. It was just straight up slow..

它在一台相当新的Win7机器上的Eclipse Indigo上运行SpringMVC/EclipseLink应用程序,连接到DB2本地数据库,大约需要15分钟才能建立第一个连接(以下数据加载似乎要快得多)-也要建立连接,因为它只是一个用户,并且表中没有太多用户数据.

Its running SpringMVC/EclipseLink app on Eclipse Indigo on a pretty new Win7 machine, connecting to a DB2 local database and it takes about 15minutes to make the first connection (following loads of data seem a lot quicker) - it just seems to be about making the connection too, as its just a user look up, and there isnt much user data in the tables.

这篇关于EntiyManager CreateQuery挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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