You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Guilherme541 Gamer <mo...@gmail.com> on 2016/04/27 15:06:24 UTC

Multi-Database

Sorry for bad english. In fact I want to know how to connect a particular
entity A in a database A and another entity B in another database B. I ask
again apologize for the e-mail nickname , my son changed. I have been using
APACHE ISIS framework on health systems in my city because I am a public
agent in Brasil city Porto Velho - Rondônia. I implemented the records only
for patients SUS card, a benefit given by the Brazilian government.
Grateful for your attention.


Moacir Bishop Camata

Re: Multi-Database

Posted by Kambiz Darabi <da...@m-creations.com>.
Hi Dan,

I created a pull request:

https://github.com/datanucleus/datanucleus-core/pull/71

This is probably the most transparent way of getting his feedback.

Cheers

Kambiz


On 2016-04-29 12:47 CEST, Dan Haywood <da...@haywood-associates.co.uk> wrote:

> Hi Kambiz,
>
> Email is how I usually contact him: andy<at>datanucleus.org
>
> Mentioning you are part of the Apache Isis community (and my name)
> won't do any harm. Do cc me if you wish.
>
> Cheers
> Dan
>
> On 29 April 2016 at 11:42, Kambiz Darabi <da...@m-creations.com>
> wrote:
>
>     Hi Dan,
>     
>     we haven't contacted the DataNucleus people, but this is on my
>     list of
>     things to do.
>     
>     What is the best channel to reach Andy Jefferson?
>     
>     Thanks
>     
>     
>     Kambiz
>     
>     
>     
>     On 2016-04-29 10:32 CEST, Dan Haywood
>     <da...@haywood-associates.co.uk> wrote:
>     
>     > Very interesting, Kambiz... thanks.
>     >
>     > Is Andy Jefferson (of DataNucleus) aware of this work? Is there
>     any chance
>     > that your work might be incorporated back into datanucleus-core?
>     >
>     > Dan
>     >
>     > On 28 April 2016 at 12:56, Kambiz Darabi
>     <da...@m-creations.com> wrote:
>     >
>     >> Hi Moacir,
>     >>
>     >> we worked on the same problem recently and have a moderately
>     working
>     >> solution, but it involved a patch to DataNucleus itself.
>     >>
>     >> This is how an entity is annotated:
>     >>
>     >> @PersistenceCapable(identityType = IdentityType.DATASTORE,
>     schema =
>     >> "subscription_service", table = "subscribers")
>     >> @Extension(vendorName = "datanucleus", key = "datastore", value
>     =
>     >> "store-subscription")
>     >> ...
>     >> public class Subscriber ...
>     >>
>     >> Note the 'datastore' key with value 'store-subscription'.
>     >>
>     >> Matching to that value, we have this in
>     persistor_datanucleus.properties:
>     >>
>     >>
>     >>
>     isis.persistor.datanucleus.impl.datanucleus.datastore.store-subscription=persistor_subscription.properties
>    
>     >>
>     >> and finally the file persistor_subscription.properties which
>     contains
>     >> the usual:
>     >>
>     >> javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
>     >>
>     >>
>     javax.jdo.option.ConnectionURL=jdbc:mysql://localhost:3306/subscription_service
>    
>     >> javax.jdo.option.ConnectionUserName=root
>     >> javax.jdo.option.ConnectionPassword=tiger
>     >>
>     >>
>     >> This is the branch containing the commit which we have tested
>     with
>     >> datanucleus-core-4.1.2 and 4.1.7:
>     >>
>     >>
>     >>
>     https://github.com/m-creations/datanucleus-core/commits/mcreations-federatedstoremanager
>    
>     >>
>     >> If you are interested in trying it out and don't want to build
>     >> datanucleus-core yourself, I could release a patched 4.1.7
>     version which
>     >> is compatible with Isis 1.12.1.
>     >>
>     >> Hope this helps
>     >>
>     >>
>     >> Kambiz
>     >>
>     >>
>     >> On 2016-04-27 15:06 CEST, Guilherme541 Gamer
>     <mo...@gmail.com>
>     >> wrote:
>     >>
>     >> > Sorry for bad english. In fact I want to know how to connect
>     a particular
>     >> > entity A in a database A and another entity B in another
>     database B. I
>     >> ask
>     >> > again apologize for the e-mail nickname , my son changed. I
>     have been
>     >> using
>     >> > APACHE ISIS framework on health systems in my city because I
>     am a public
>     >> > agent in Brasil city Porto Velho - Rondônia. I implemented
>     the records
>     >> only
>     >> > for patients SUS card, a benefit given by the Brazilian
>     government.
>     >> > Grateful for your attention.
>     >> >
>     >> >
>     >> > Moacir Bishop Camata
>     >>

Re: Multi-Database

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Kambiz,

Email is how I usually contact him:  andy<at>datanucleus.org

Mentioning you are part of the Apache Isis community (and my name) won't do
any harm.  Do cc me if you wish.

Cheers
Dan


On 29 April 2016 at 11:42, Kambiz Darabi <da...@m-creations.com> wrote:

> Hi Dan,
>
> we haven't contacted the DataNucleus people, but this is on my list of
> things to do.
>
> What is the best channel to reach Andy Jefferson?
>
> Thanks
>
>
> Kambiz
>
> On 2016-04-29 10:32 CEST, Dan Haywood <da...@haywood-associates.co.uk>
> wrote:
>
> > Very interesting, Kambiz... thanks.
> >
> > Is Andy Jefferson (of DataNucleus) aware of this work?  Is there any
> chance
> > that your work might be incorporated back into datanucleus-core?
> >
> > Dan
> >
> > On 28 April 2016 at 12:56, Kambiz Darabi <da...@m-creations.com> wrote:
> >
> >> Hi Moacir,
> >>
> >> we worked on the same problem recently and have a moderately working
> >> solution, but it involved a patch to DataNucleus itself.
> >>
> >> This is how an entity is annotated:
> >>
> >> @PersistenceCapable(identityType = IdentityType.DATASTORE, schema =
> >> "subscription_service", table = "subscribers")
> >> @Extension(vendorName = "datanucleus", key = "datastore", value =
> >> "store-subscription")
> >> ...
> >> public class Subscriber ...
> >>
> >> Note the 'datastore' key with value 'store-subscription'.
> >>
> >> Matching to that value, we have this in
> persistor_datanucleus.properties:
> >>
> >>
> >>
> isis.persistor.datanucleus.impl.datanucleus.datastore.store-subscription=persistor_subscription.properties
> >>
> >> and finally the file persistor_subscription.properties which contains
> >> the usual:
> >>
> >> javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
> >>
> >>
> javax.jdo.option.ConnectionURL=jdbc:mysql://localhost:3306/subscription_service
> >> javax.jdo.option.ConnectionUserName=root
> >> javax.jdo.option.ConnectionPassword=tiger
> >>
> >>
> >> This is the branch containing the commit which we have tested with
> >> datanucleus-core-4.1.2 and 4.1.7:
> >>
> >>
> >>
> https://github.com/m-creations/datanucleus-core/commits/mcreations-federatedstoremanager
> >>
> >> If you are interested in trying it out and don't want to build
> >> datanucleus-core yourself, I could release a patched 4.1.7 version which
> >> is compatible with Isis 1.12.1.
> >>
> >> Hope this helps
> >>
> >>
> >> Kambiz
> >>
> >>
> >> On 2016-04-27 15:06 CEST, Guilherme541 Gamer <
> moacirbishopcamata@gmail.com>
> >> wrote:
> >>
> >> > Sorry for bad english. In fact I want to know how to connect a
> particular
> >> > entity A in a database A and another entity B in another database B. I
> >> ask
> >> > again apologize for the e-mail nickname , my son changed. I have been
> >> using
> >> > APACHE ISIS framework on health systems in my city because I am a
> public
> >> > agent in Brasil city Porto Velho - Rondônia. I implemented the records
> >> only
> >> > for patients SUS card, a benefit given by the Brazilian government.
> >> > Grateful for your attention.
> >> >
> >> >
> >> > Moacir Bishop Camata
> >>
>

Re: Multi-Database

Posted by Kambiz Darabi <da...@m-creations.com>.
Hi Dan,

we haven't contacted the DataNucleus people, but this is on my list of
things to do.

What is the best channel to reach Andy Jefferson?

Thanks


Kambiz

On 2016-04-29 10:32 CEST, Dan Haywood <da...@haywood-associates.co.uk> wrote:

> Very interesting, Kambiz... thanks.
>
> Is Andy Jefferson (of DataNucleus) aware of this work?  Is there any chance
> that your work might be incorporated back into datanucleus-core?
>
> Dan
>
> On 28 April 2016 at 12:56, Kambiz Darabi <da...@m-creations.com> wrote:
>
>> Hi Moacir,
>>
>> we worked on the same problem recently and have a moderately working
>> solution, but it involved a patch to DataNucleus itself.
>>
>> This is how an entity is annotated:
>>
>> @PersistenceCapable(identityType = IdentityType.DATASTORE, schema =
>> "subscription_service", table = "subscribers")
>> @Extension(vendorName = "datanucleus", key = "datastore", value =
>> "store-subscription")
>> ...
>> public class Subscriber ...
>>
>> Note the 'datastore' key with value 'store-subscription'.
>>
>> Matching to that value, we have this in persistor_datanucleus.properties:
>>
>>
>> isis.persistor.datanucleus.impl.datanucleus.datastore.store-subscription=persistor_subscription.properties
>>
>> and finally the file persistor_subscription.properties which contains
>> the usual:
>>
>> javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
>>
>> javax.jdo.option.ConnectionURL=jdbc:mysql://localhost:3306/subscription_service
>> javax.jdo.option.ConnectionUserName=root
>> javax.jdo.option.ConnectionPassword=tiger
>>
>>
>> This is the branch containing the commit which we have tested with
>> datanucleus-core-4.1.2 and 4.1.7:
>>
>>
>> https://github.com/m-creations/datanucleus-core/commits/mcreations-federatedstoremanager
>>
>> If you are interested in trying it out and don't want to build
>> datanucleus-core yourself, I could release a patched 4.1.7 version which
>> is compatible with Isis 1.12.1.
>>
>> Hope this helps
>>
>>
>> Kambiz
>>
>>
>> On 2016-04-27 15:06 CEST, Guilherme541 Gamer <mo...@gmail.com>
>> wrote:
>>
>> > Sorry for bad english. In fact I want to know how to connect a particular
>> > entity A in a database A and another entity B in another database B. I
>> ask
>> > again apologize for the e-mail nickname , my son changed. I have been
>> using
>> > APACHE ISIS framework on health systems in my city because I am a public
>> > agent in Brasil city Porto Velho - Rondônia. I implemented the records
>> only
>> > for patients SUS card, a benefit given by the Brazilian government.
>> > Grateful for your attention.
>> >
>> >
>> > Moacir Bishop Camata
>>

Re: Multi-Database

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Very interesting, Kambiz... thanks.

Is Andy Jefferson (of DataNucleus) aware of this work?  Is there any chance
that your work might be incorporated back into datanucleus-core?

Dan

On 28 April 2016 at 12:56, Kambiz Darabi <da...@m-creations.com> wrote:

> Hi Moacir,
>
> we worked on the same problem recently and have a moderately working
> solution, but it involved a patch to DataNucleus itself.
>
> This is how an entity is annotated:
>
> @PersistenceCapable(identityType = IdentityType.DATASTORE, schema =
> "subscription_service", table = "subscribers")
> @Extension(vendorName = "datanucleus", key = "datastore", value =
> "store-subscription")
> ...
> public class Subscriber ...
>
> Note the 'datastore' key with value 'store-subscription'.
>
> Matching to that value, we have this in persistor_datanucleus.properties:
>
>
> isis.persistor.datanucleus.impl.datanucleus.datastore.store-subscription=persistor_subscription.properties
>
> and finally the file persistor_subscription.properties which contains
> the usual:
>
> javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
>
> javax.jdo.option.ConnectionURL=jdbc:mysql://localhost:3306/subscription_service
> javax.jdo.option.ConnectionUserName=root
> javax.jdo.option.ConnectionPassword=tiger
>
>
> This is the branch containing the commit which we have tested with
> datanucleus-core-4.1.2 and 4.1.7:
>
>
> https://github.com/m-creations/datanucleus-core/commits/mcreations-federatedstoremanager
>
> If you are interested in trying it out and don't want to build
> datanucleus-core yourself, I could release a patched 4.1.7 version which
> is compatible with Isis 1.12.1.
>
> Hope this helps
>
>
> Kambiz
>
>
> On 2016-04-27 15:06 CEST, Guilherme541 Gamer <mo...@gmail.com>
> wrote:
>
> > Sorry for bad english. In fact I want to know how to connect a particular
> > entity A in a database A and another entity B in another database B. I
> ask
> > again apologize for the e-mail nickname , my son changed. I have been
> using
> > APACHE ISIS framework on health systems in my city because I am a public
> > agent in Brasil city Porto Velho - Rondônia. I implemented the records
> only
> > for patients SUS card, a benefit given by the Brazilian government.
> > Grateful for your attention.
> >
> >
> > Moacir Bishop Camata
>

Re: Multi-Database

Posted by Kambiz Darabi <da...@m-creations.com>.
Hi Cesar,

to be honest, I haven't checked the exact commit behaviour, but I will
enable detailed logging and run some tests. Then I'll get back to you.

Cheers


Kambiz

On 2016-05-05 20:33 CEST, Cesar Lugo <ce...@sisorg.com.mx> wrote:

> Hello. 
>
> I was just wondering if this solution will consider 2 phase commit, so
> if I create a transaction in Apache ISIS (which I understand are
> automatically managed) that involves entity A in database A and entity
> B in database B with mutable values in both (updating the values of
> some fields from both entities in both databases), it either commits
> or rolls back the entire transaction in both databases. Is this the
> way it works?
>
> -----Original Message-----
> From: Kambiz Darabi [mailto:darabi@m-creations.com] 
> Sent: Thursday, April 28, 2016 6:57 AM
> To: Guilherme541 Gamer
> Cc: users@isis.apache.org
> Subject: Re: Multi-Database
>
> Hi Moacir,
>
> we worked on the same problem recently and have a moderately working solution, but it involved a patch to DataNucleus itself.
>
> This is how an entity is annotated:
>
> @PersistenceCapable(identityType = IdentityType.DATASTORE, schema =
> "subscription_service", table = "subscribers") @Extension(vendorName =
> "datanucleus", key = "datastore", value = "store-subscription") ...
> public class Subscriber ...
>
> Note the 'datastore' key with value 'store-subscription'.
>
> Matching to that value, we have this in persistor_datanucleus.properties:
>
> isis.persistor.datanucleus.impl.datanucleus.datastore.store-subscription=persistor_subscription.properties
>
> and finally the file persistor_subscription.properties which contains the usual:
>
> javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
> javax.jdo.option.ConnectionURL=jdbc:mysql://localhost:3306/subscription_service
> javax.jdo.option.ConnectionUserName=root
> javax.jdo.option.ConnectionPassword=tiger
>
>
> This is the branch containing the commit which we have tested with
> datanucleus-core-4.1.2 and 4.1.7:
>
> https://github.com/m-creations/datanucleus-core/commits/mcreations-federatedstoremanager
>
> If you are interested in trying it out and don't want to build datanucleus-core yourself, I could release a patched 4.1.7 version which is compatible with Isis 1.12.1.
>
> Hope this helps
>
>
> Kambiz
>
>
> On 2016-04-27 15:06 CEST, Guilherme541 Gamer <mo...@gmail.com> wrote:
>
>> Sorry for bad english. In fact I want to know how to connect a 
>> particular entity A in a database A and another entity B in another 
>> database B. I ask again apologize for the e-mail nickname , my son 
>> changed. I have been using APACHE ISIS framework on health systems in 
>> my city because I am a public agent in Brasil city Porto Velho - 
>> Rondônia. I implemented the records only for patients SUS card, a benefit given by the Brazilian government.
>> Grateful for your attention.
>>
>>
>> Moacir Bishop Camata
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus

RE: Multi-Database

Posted by Cesar Lugo <ce...@sisorg.com.mx>.
Hello. 

I was just wondering if this solution will consider 2 phase commit, so if I create a transaction in Apache ISIS (which I understand are automatically managed) that involves entity A in database A and entity B in database B with mutable values in both (updating the values of some fields from both entities in both databases), it either commits or rolls back the entire transaction in both databases. Is this the way it works?

-----Original Message-----
From: Kambiz Darabi [mailto:darabi@m-creations.com] 
Sent: Thursday, April 28, 2016 6:57 AM
To: Guilherme541 Gamer
Cc: users@isis.apache.org
Subject: Re: Multi-Database

Hi Moacir,

we worked on the same problem recently and have a moderately working solution, but it involved a patch to DataNucleus itself.

This is how an entity is annotated:

@PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "subscription_service", table = "subscribers") @Extension(vendorName = "datanucleus", key = "datastore", value = "store-subscription") ...
public class Subscriber ...

Note the 'datastore' key with value 'store-subscription'.

Matching to that value, we have this in persistor_datanucleus.properties:

isis.persistor.datanucleus.impl.datanucleus.datastore.store-subscription=persistor_subscription.properties

and finally the file persistor_subscription.properties which contains the usual:

javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
javax.jdo.option.ConnectionURL=jdbc:mysql://localhost:3306/subscription_service
javax.jdo.option.ConnectionUserName=root
javax.jdo.option.ConnectionPassword=tiger


This is the branch containing the commit which we have tested with
datanucleus-core-4.1.2 and 4.1.7:

https://github.com/m-creations/datanucleus-core/commits/mcreations-federatedstoremanager

If you are interested in trying it out and don't want to build datanucleus-core yourself, I could release a patched 4.1.7 version which is compatible with Isis 1.12.1.

Hope this helps


Kambiz


On 2016-04-27 15:06 CEST, Guilherme541 Gamer <mo...@gmail.com> wrote:

> Sorry for bad english. In fact I want to know how to connect a 
> particular entity A in a database A and another entity B in another 
> database B. I ask again apologize for the e-mail nickname , my son 
> changed. I have been using APACHE ISIS framework on health systems in 
> my city because I am a public agent in Brasil city Porto Velho - 
> Rondônia. I implemented the records only for patients SUS card, a benefit given by the Brazilian government.
> Grateful for your attention.
>
>
> Moacir Bishop Camata


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


Re: Multi-Database

Posted by Kambiz Darabi <da...@m-creations.com>.
Hi Moacir,

we worked on the same problem recently and have a moderately working
solution, but it involved a patch to DataNucleus itself.

This is how an entity is annotated:

@PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "subscription_service", table = "subscribers")
@Extension(vendorName = "datanucleus", key = "datastore", value = "store-subscription")
...
public class Subscriber ...

Note the 'datastore' key with value 'store-subscription'.

Matching to that value, we have this in persistor_datanucleus.properties:

isis.persistor.datanucleus.impl.datanucleus.datastore.store-subscription=persistor_subscription.properties

and finally the file persistor_subscription.properties which contains
the usual:

javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
javax.jdo.option.ConnectionURL=jdbc:mysql://localhost:3306/subscription_service
javax.jdo.option.ConnectionUserName=root
javax.jdo.option.ConnectionPassword=tiger


This is the branch containing the commit which we have tested with
datanucleus-core-4.1.2 and 4.1.7:

https://github.com/m-creations/datanucleus-core/commits/mcreations-federatedstoremanager

If you are interested in trying it out and don't want to build
datanucleus-core yourself, I could release a patched 4.1.7 version which
is compatible with Isis 1.12.1.

Hope this helps


Kambiz


On 2016-04-27 15:06 CEST, Guilherme541 Gamer <mo...@gmail.com> wrote:

> Sorry for bad english. In fact I want to know how to connect a particular
> entity A in a database A and another entity B in another database B. I ask
> again apologize for the e-mail nickname , my son changed. I have been using
> APACHE ISIS framework on health systems in my city because I am a public
> agent in Brasil city Porto Velho - Rondônia. I implemented the records only
> for patients SUS card, a benefit given by the Brazilian government.
> Grateful for your attention.
>
>
> Moacir Bishop Camata