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


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

Re: JPA OneToOne annotation across two different jdbc drivers

Date 2011-11-22 19:14 +0100
From jlp <jlp@jlp.com>
Newsgroups comp.lang.java.programmer
Subject Re: JPA OneToOne annotation across two different jdbc drivers
References <jaes5h$8bo$1@dont-email.me> <26839074.317.1321974960424.JavaMail.geo-discussion-forums@prdy11>
Message-ID <4ecbe668$0$5679$ba4acef3@reader.news.orange.fr> (permalink)
Organization les newsgroups par Orange

Show all headers | View raw


Le 22/11/2011 16:16, Lew a écrit :
> Jeffrey H. Coffield wrote:
>> We have data in two different databases types (MySQL and OpenVMS). Both
>> have JDBC drivers. Does someone have an example of using the JPA
>> annotations to connect across two different persistence units?
>
> What, precisely, do you mean by "connect across two different persistence units"?
>
> You can connect to two persistence units by defining two 'EntityManager' instances, one for each PU.
>
> Is that what you're asking for?
>
> Which annotations did you have in mind?  Certainly '@Entity' and '@EntityManager' will work with multiple persistence units.  Of course, annotations like '@OneToMany' will not, AFAIK, since they map to foreign-key relationships in the DBMS.
>
> How about giving us a /precise/ explanation of what you wish to accomplish?
>
> Programming is an art of precision.  "Using annotations to connect across two persistence units" is so vague as to be meaningless.
>

And completing Lew 's advices
do you need XA Transaction ( 2 phases commit) between the 2 databases ?
-- 
Cordialement
Jean-Louis Pasturel

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


Thread

JPA OneToOne annotation across two different jdbc drivers "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> - 2011-11-21 16:59 -0800
  Re: JPA OneToOne annotation across two different jdbc drivers Robert Klemme <shortcutter@googlemail.com> - 2011-11-22 07:02 -0800
  Re: JPA OneToOne annotation across two different jdbc drivers Lew <lewbloch@gmail.com> - 2011-11-22 07:16 -0800
    Re: JPA OneToOne annotation across two different jdbc drivers jlp <jlp@jlp.com> - 2011-11-22 19:14 +0100
    Re: JPA OneToOne annotation across two different jdbc drivers "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> - 2011-11-22 16:26 -0800
      Re: JPA OneToOne annotation across two different jdbc drivers "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> - 2011-11-22 18:34 -0800
        Re: JPA OneToOne annotation across two different jdbc drivers Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-11-23 07:32 -0400
          Re: JPA OneToOne annotation across two different jdbc drivers Arne Vajhøj <arne@vajhoej.dk> - 2011-11-25 21:41 -0500
        Re: JPA OneToOne annotation across two different jdbc drivers "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> - 2011-11-27 16:07 -0800
          Re: JPA OneToOne annotation across two different jdbc drivers Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-11-28 06:42 -0400
      Re: JPA OneToOne annotation across two different jdbc drivers Lew <lewbloch@gmail.com> - 2011-11-23 12:38 -0800
        Re: JPA OneToOne annotation across two different jdbc drivers Gene Wirchenko <genew@ocis.net> - 2011-11-23 14:52 -0800
          Re: JPA OneToOne annotation across two different jdbc drivers Arne Vajhøj <arne@vajhoej.dk> - 2011-11-25 21:37 -0500
            Re: JPA OneToOne annotation across two different jdbc drivers Gene Wirchenko <genew@ocis.net> - 2011-11-26 21:22 -0800
              Re: JPA OneToOne annotation across two different jdbc drivers Arne Vajhøj <arne@vajhoej.dk> - 2011-12-02 21:03 -0500
  Re: JPA OneToOne annotation across two different jdbc drivers Arne Vajhøj <arne@vajhoej.dk> - 2011-11-25 21:38 -0500

csiph-web