Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Eclipselink 1.1-M4 create OSGI EntityManagerFactory

Also check out my article here:
http://www.weheartcode.com/2008/08/27/eclipselink-in-j2se-rcp-applications/

It explains one way:

     properties.put(PersistenceUnitProperties.TARGET_DATABASE, "Derby");
        properties.put(PersistenceUnitProperties.JDBC_DRIVER,
                "org.apache.derby.jdbc.ClientDriver");
        properties.put(PersistenceUnitProperties.JDBC_URL,
                "jdbc:derby://localhost:1527/sample;create=true");
        properties.put(PersistenceUnitProperties.JDBC_USER, "app");
        properties.put(PersistenceUnitProperties.JDBC_PASSWORD, "app");
        properties
                .put(PersistenceUnitProperties.JDBC_READ_CONNECTIONS_MIN, "1");
        properties.put(PersistenceUnitProperties.JDBC_WRITE_CONNECTIONS_MIN,
                "1");

        properties.put(PersistenceUnitProperties.BATCH_WRITING, "JDBC");
        properties.put(PersistenceUnitProperties.CLASSLOADER,
ComicsEntityManagerFactory.class.getClassLoader());
        properties.put("eclipselink.logging.level", "FINE");
        properties.put("eclipselink.logging.timestamp", "false");
        properties.put("eclipselink.logging.session", "false");
        properties.put("eclipselink.logging.thread", "false");

        emf = new PersistenceProvider().createEntityManagerFactory("comics",
                properties);


./tch



On Mon, Dec 8, 2008 at 9:19 AM, Tom Ware <tom.ware@xxxxxxxxxx> wrote:
> Hi Erasmo,
>
>  A good way to get started with EclipseLink and OSGi is by looking at our
> RCP demo.  It creates an EntityManager using OSGi and does some simple
> queries.
>
>  The instructions about how to use it our in the examples folder of our SVN
> view.  Here is a link to the file so you can see it.
>
> http://dev.eclipse.org/viewsvn/index.cgi/trunk/examples/org.eclipse.persistence.example.jpa.rcp.comics/ReadMe.txt?root=RT_Eclipselink&view=log
>
>  All the instructions you need can be found in that file.
>
> -Tom
>
> http://wiki.eclipse.org/SVN_Howto
>
> Erasmo wrote:
>>
>> Does anybody knows how to create an EntityManagerFactory under osgi using
>> eclipselink milestone 4? It looks like the old
>> PersistentProvider.createEntityManagerFactory is dead or something, because
>> its commanded to throw an exception if someone calls its code. Any tester
>> outthere working with M4?
>>
>> Any help appreciated.
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>


Back to the top