Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » javax.persistence.sql-load-script-source property is not effective(javax.persistence.sql-load-script-source seems to be ignored)
javax.persistence.sql-load-script-source property is not effective [message #1709182] Thu, 24 September 2015 16:18 Go to next message
David Mising name is currently offline David Mising nameFriend
Messages: 24
Registered: June 2010
Junior Member
I configured this persistence unit trying to insert some data into some tables. But rows are not inserted (tables were created fine); and I can not find any trace (success or fail) in eclipselink log.

I am running in a bundle environment; and involved bundles are list below as well ...

Any idea of what might be wrong is greatly appreciated!!

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
             http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
             version="2.1">

    <persistence-unit name="MyUnit" transaction-type="RESOURCE_LOCAL">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        
		<class>...</class>
		<class>...</class>
		<properties>
			<property name="javax.persistence.sql-load-script-source" value="META-INF/initiate_realm.sql" />
		</properties>
          
	</persistence-unit>
</persistence>


Bundles,

	eclipsePlugins(group: 'org.eclipse.persistence', name: 'javax.persistence', version: '2.1.0')
	eclipsePlugins(group: 'org.eclipse.persistence', name: 'org.eclipse.persistence.jpa', version: '2.5.2')
	eclipsePlugins(group: 'org.eclipse.persistence', name: 'org.eclipse.persistence.jpa.jpql', version: '2.5.2')
	eclipsePlugins(group: 'org.eclipse.persistence', name: 'org.eclipse.persistence.antlr', version: '3.2.0')
	eclipsePlugins(group: 'org.eclipse.persistence', name: 'org.eclipse.persistence.asm', version: '3.3.1')
	eclipsePlugins(group: 'org.eclipse.persistence', name: 'org.eclipse.persistence.core', version: '2.5.2')


[Updated on: Thu, 24 September 2015 16:19]

Report message to a moderator

Re: javax.persistence.sql-load-script-source property is not effective [message #1709210 is a reply to message #1709182] Fri, 25 September 2015 00:27 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1382
Registered: July 2009
Senior Member
How are you obtaining, beginning and committing transactions?
Re: javax.persistence.sql-load-script-source property is not effective [message #1709258 is a reply to message #1709210] Fri, 25 September 2015 11:54 Go to previous messageGo to next message
David Mising name is currently offline David Mising nameFriend
Messages: 24
Registered: June 2010
Junior Member
Yes. We had transaction obtained on the database. But it failed of course since the it depends on the rows need to added.

Is there a Eclipselink side of attribute equivalence to "javax.persistence.sql-load-script-source"?

Thanks!
Re: javax.persistence.sql-load-script-source property is not effective [message #1709642 is a reply to message #1709258] Tue, 29 September 2015 20:59 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1382
Registered: July 2009
Senior Member
Logging should show the statements that are getting executed. Since you aren't specifying the "javax.persistence.schema-generation.database.action" or "eclipselink.ddl-generation" properties, how are your tables being created?
Re: javax.persistence.sql-load-script-source property is not effective [message #1709771 is a reply to message #1709642] Wed, 30 September 2015 19:44 Go to previous messageGo to next message
David Mising name is currently offline David Mising nameFriend
Messages: 24
Registered: June 2010
Junior Member
Since we are running in a OSGi environment, all the DDL settings are setup via an OSGi Configuration service with id "gemini.jpa.punit". It is like,

			Configuration config = conf.createFactoryConfiguration("gemini.jpa.punit", null);
			Dictionary<String, String> props = new Hashtable<String, String>();
			props.put("gemini.jpa.punit.name", "MyName");

    			props.put("eclipselink.target-database", "PostgreSQL");
 			props.put("javax.persistence.jdbc.driver", "org.postgresql.Driver");
			
			props.put("javax.persistence.jdbc.url", "xxxx");
			props.put("javax.persistence.jdbc.user", "xxxx");
                        props.put("javax.persistence.jdbc.password", "password");

			props.put("eclipselink.weaving", "false");
			props.put("eclipselink.logging.level", "ALL");
                        props.put("eclipselink.logging.file", "/opt/tomcat6/logs/eclipselink.log");
			props.put("eclipselink.logging.timestamp", "false");
			props.put("eclipselink.logging.thread", "false");
			props.put("eclipselink.logging.exceptions", "true");
			props.put("eclipselink.orm.throw.exceptions", "true");
			props.put("eclipselink.jdbc.read-connections.min", "1");
			props.put("eclipselink.jdbc.write-connections.min", "1");
			props.put("eclipselink.ddl-generation", "create-or-extend-tables");
			config.update(props);


I have tried to add the following to the props; however it doesn't make a difference, and not logs.

props.put("javax.persistence.sql-load-script-source", "/opt/tomcat6/configurations/initiate.sql");


Thanks!

[Updated on: Wed, 30 September 2015 19:46]

Report message to a moderator

Re: javax.persistence.sql-load-script-source property is not effective [message #1709773 is a reply to message #1709771] Wed, 30 September 2015 19:46 Go to previous message
David Mising name is currently offline David Mising nameFriend
Messages: 24
Registered: June 2010
Junior Member
and I have tried this also,

props.put("javax.persistence.sql-load-script-source", "META-INF/initiate.sql");

[Updated on: Wed, 30 September 2015 19:47]

Report message to a moderator

Previous Topic:Using JPA-RS in Equinox (via gemini)
Next Topic:NoSQL|Mongo : How to use ObjectID ?
Goto Forum:
  


Current Time: Thu Apr 15 03:20:40 GMT 2021

Powered by FUDForum. Page generated in 0.02380 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top