EntiyManager CreateQuery Hangs

做~自己de王妃 提交于 2019-12-13 03:58:57

问题


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.

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).

The DAO method is as follows:

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();

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).

Any ideas?


回答1:


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

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.



来源:https://stackoverflow.com/questions/9914271/entiymanager-createquery-hangs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!