Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: Re: Performance JPA Date: Wed, 04 Nov 2015 11:19:51 +0100 Organization: Decebal Computing Lines: 42 Message-ID: <87a8quhxrs.fsf@Equus.decebal.nl> References: <87lhagkcsh.fsf@Equus.decebal.nl> <563763d9$0$23727$e4fe514c@news.xs4all.nl> <87d1vrk20x.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="528adfd6ad074c92fdc6a7f8fb9e23d8"; logging-data="14865"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Qvquuhn8YXcASarW1VjFsbaBELLgftXM=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:JeXWMgYp1ZcV+X+EuSXCC4YY8ik= sha1:dg/onjGTt7wZa07ra2/qiuQE8Bo= X-Homepage: http://www.decebal.nl/ Xref: csiph.com comp.lang.java.programmer:32999 On Wednesday 4 Nov 2015 02:42 CET, Arne Vajhøj wrote: > On 11/3/2015 1:52 AM, Cecil Westerhof wrote: >> On Monday 2 Nov 2015 14:23 CET, silvio@internet.com wrote: >>> But let's put that aside and see if we can fix your situation. >>> Please tell us what the typical database access from your >>> application looks like and which things are particularly slow in >>> comparison to how it was? >> >> At the moment I am told that everything is slower. I am told that a >> query that took at most 5 seconds now takes one to two minutes. But >> I asked them to measure the old situation and until now they did >> not do this. I hope to get today real data about this. But several >> pages now give a timeout. > > Has anything else changed besides plain JDBC -> JPA? > > If yes, then it is even harder. Yes, there has been a complete overhaul of the application. But at first it was said that the first fetch is a lot slower as when it is fetched again. That was why we thought the culprit was JPA. That is only in a certain case, so it could be a lot of things now I am afraid. >> As I understood it until now, there should be a little overhead, >> but it can be worse I understand now. As said in the above >> rowmapper was used. Now the application uses em.find to read. For >> displaying a page only reads are done, so using em.find instead >> rs.get... seems to make a very big difference. Is there a reason >> for this and can there be something done about this? > > If you are retrieving many objects, then you should not be using > em.find but em.createQuery. I think we are doing that. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof