If all you want is to change a property once you can use the
createEntityManagerFactory(String, Map) api to create the
EntityManagerFactory setting the property and value into the Map.
--Gordon
zineb bentaleb wrote:
>
> ----- Original Message -----
> *From:* zineb bentaleb <mailto:zinebbentaleb_at_menara.ma>
> *To:* persistence_at_glassfish.dev.java.net
> <mailto:persistence_at_glassfish.dev.java.net>
> *Sent:* Wednesday, January 14, 2009 4:04 AM
> *Subject:* configure properties in persistence.xml at runtime
>
> Hello
>
> I'm using this persistence.xml file and i want to change properties at
> runtime; How can I do it :
>
>
> <?xml version=/"1.0"/ encoding=/"UTF-8"/?>
>
> <persistence version=/"1.0"/
> xmlns=/"http://java.sun.com/xml/ns/persistence"/>
>
> <persistence-unit name=/"EmployeeService"/
> transaction-type=/"RESOURCE_LOCAL"/>
>
> <class>_com_._shemsit_.model.Employee</class>
>
> <properties>
>
> <property name=/"toplink.jdbc.driver"/ value=/"com.mysql.jdbc.Driver"//>
>
> <property name=/"toplink.jdbc.url"/
> value=/"jdbc:mysql://localhost:3306/testJPA"//>
>
> <property name=/"toplink.jdbc.user"/ value=/"root"//>
>
> <property name=/"toplink.jdbc.password"/ value=/"root"//>
>
> <!-- enable this property to see SQL and other logging -->
>
> <!-- property name="_toplink_.logging.level" value="FINE"/ -->
>
> <!--<property name="" value="_app_"/>-->
>
> </properties>
>
> </persistence-unit>
>
> </persistence>
>
> Zineb.
>