Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32357

Re: Is it possible to use JPA and JDBC at the same time

Path csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.java.programmer
Subject Re: Is it possible to use JPA and JDBC at the same time
Date Wed, 19 Aug 2015 11:57:36 +0200
Organization Decebal Computing
Lines 36
Message-ID <87io8br46n.fsf@Equus.decebal.nl> (permalink)
References <87vbcj3vja.fsf@Equus.decebal.nl> <55cd346e$0$304$14726298@news.sunsite.dk> <87mvxqsa9n.fsf@Equus.decebal.nl> <55d271ba$0$301$14726298@news.sunsite.dk>
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="6908"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qzxyiKkj2IsCz85/E26urvsA9AKnuv9k="
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:OZ6Zx/QrAAVX1XlkodSgKV9lcuA= sha1:sjZ7JVZ6/Hgur0YSZP97s5BRrUo=
X-Homepage http://www.decebal.nl/
Xref csiph.com comp.lang.java.programmer:32357

Show key headers only | View raw


On Tuesday 18 Aug 2015 01:43 CEST, Arne Vajhøj wrote:

> On 8/17/2015 2:24 AM, Cecil Westerhof wrote:
>> On Friday 14 Aug 2015 02:21 CEST, Arne Vajhøj wrote:
>>> On 8/13/2015 2:14 PM, Cecil Westerhof wrote:
>>>> I am new to JPA and have to migrate an application from JDBC to
>>>> JPA. There are quite some queries. Would it be possible to mix
>>>> JDBC and JPA together?
>>>>
>>>> I would suppose not, but if it was possible, that would
>>>> circumvent a big bang.
>>>
>>> The standard problems with using two persistence frameworks are
>>> cache inconsistencies and transactional issues.
>>>
>>> I have not read the fine print in the JPA specs to say whether
>>> this would be a problem for JPA and JDBC.
>>>
>>> But I would probably go for big bang JPA. Lower risk. And
>>> with createNativeQuery you can execute SQL queries (so you
>>> can reuse you existent SQL queries).
>>
>> I was afraid for that. ;-) There are a lot of queries. :-( But for
>> testing purposes I could maybe do it class by class.
>
> Look at it from the positive - you can probably
> replace 15 lines of code with JDBC with 1 line of code
> using JPA in most places and by that help clean up the code.

Yes, that is one of the big benefits. Also that changes are only
needed in the class itself.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Is it possible to use JPA and JDBC at the same time Cecil Westerhof <Cecil@decebal.nl> - 2015-08-13 20:14 +0200
  Re: Is it possible to use JPA and JDBC at the same time Arne Vajhøj <arne@vajhoej.dk> - 2015-08-13 20:21 -0400
    Re: Is it possible to use JPA and JDBC at the same time Cecil Westerhof <Cecil@decebal.nl> - 2015-08-17 08:24 +0200
      Re: Is it possible to use JPA and JDBC at the same time Arne Vajhøj <arne@vajhoej.dk> - 2015-08-17 19:43 -0400
        Re: Is it possible to use JPA and JDBC at the same time Cecil Westerhof <Cecil@decebal.nl> - 2015-08-19 11:57 +0200

csiph-web