can play work with two databases inside one app?

Asked by xiaocase

can play work with two databases inside one app? how to configure and how to use? thank you!

Question information

Language:
English Edit question
Status:
Solved
For:
play framework Edit question
Assignee:
No assignee Edit question
Solved by:
Jean-Francois POUX
Solved:
Last query:
Last reply:
Revision history for this message
Guillaume Bort (guillaume-bort) said :
#1

The included database management works only with a single datasource.

So you can define your own datasources outside the framework but they will
not be used in
automatic transaction management and JPA support ...

On Sun, Jan 11, 2009 at 9:12 AM, xiaocase <
<email address hidden>> wrote:

> New question #57050 on play framework:
> https://answers.launchpad.net/play/+question/57050
>
> can play work with two databases inside one app? how to configure and how
> to use? thank you!
>
> --
> You received this question notification because you are a member of play
> framework developers, which is an answer contact for play framework.
>

Revision history for this message
Best Jean-Francois POUX (jfp-taldius) said :
#2

Hi,

PlayBD and persistance support are implemented using play plugins (JPAPlugin and DBPlugin). So, if you need the 2 db feature and want it tightly integrated to play, writing your own JPA/DB plugin is the way to go.

Revision history for this message
xiaocase (xiaocase1528) said :
#3

Thanks Jean-Francois POUX, that solved my question.

Revision history for this message
Lee Breisacher (leeb-linkline) said :
#4

xiaocase, did you manage to write a plugin that can handle two databases in one app? I would like to do that too.

Thanks,

Lee