users@glassfish.java.net

[lassfish + JPA] Java2DB not working - no ddl scripts generated

From: <glassfish_at_javadesktop.org>
Date: Thu, 20 Nov 2008 04:21:06 PST

Hi.
I am trying to make automatic ddl generation work, but I am failing :-(
I am following this: http://blogs.sun.com/java2dbInGlassFish/entry/automatic_table_generation_feature_in
and so my persistence.xml file looks like this:

[code]
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">

    <persistence-unit name="TestEJB" transaction-type="JTA">
        <jta-data-source>jdbc/OracleXEPool</jta-data-source>
        <properties>
            <property name="toplink.ddl-generation" value="drop-and-create-tables "/>
            <property name="toplink.create-ddl-jdbc-file-name" value="create.ddl" />
            <property name="toplink.drop-ddl-jdbc-file-name" value="drop.ddl" />
            <property name="toplink.logging.level" value="FINEST" />
        </properties>
    </persistence-unit>

</persistence>
[/code]

When I deploy the application, nothing happens, and by looking at the logs, the properties are ignored. The usual stuff happens - the entities are discovered and configured, and that's it.
I also tried changing that to resource-local persistence (added the necessary properties as user, password and so on), and although the code works, no sql scripts are created. I tried adding this:
[code]
<property name="toplink.ddl-generation.output-mode" value="sql-script"/>
[/code]
but still nothing.
I also tried changing the prefix from "toplink." to "toplink.jdbc.", also didn't change anything.
Version = Sun Java System Application Server 9.1_02
What am I doing wrong?
Thank you.
[Message sent by forum member 'szczyp' (szczyp)]

http://forums.java.net/jive/thread.jspa?messageID=317834