Modifying Persistence Connection Properties Dynamically

Product:
JPA 2.0 (Eclipse Link version)

Case:
We don't know which database to connect. In run-time, the connection factory (information) for the database we want to connect will be provided.
Sample information is as follows:

<persistence-unit name="PersistenceContextName" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
(...)
<properties>
       <property name="eclipselink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
       <property name="eclipselink.jdbc.url" value="jdbc:mysql://localhost:3306/dial_db"/>
       <property name="eclipselink.jdbc.user" value="root"/>
       <property name="eclipselink.jdbc.password" value="mysql"/>
</properties>
</persistence-unit>

Open in new window


What we want to do is to update connection properties dynamically (on-the-fly) without terminating Connection Factory.

How can we accomplish it? Any suggestions?

Thank you in advance,

Ali Koyuncu
akoyuncuAsked:
Who is Participating?
 
Maen Abu-TabanjehNetwork Administrator, Network ConsultantCommented:
0
 
Maen Abu-TabanjehNetwork Administrator, Network ConsultantCommented:
0
 
akoyuncuAuthor Commented:
Jordannet;

Thank you for your comment. However, our application is supposed to perform this process in run-time.
0
 
akoyuncuAuthor Commented:
Jordan,

Thank you for your comment on this matter. Give us some days to test and verify this.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.