[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [eclipselink-users] Eclipselink 1.1-M4 create OSGI EntityManagerFactory
|
- From: "Tim Hollosy" <hollosyt@xxxxxxxxx>
- Date: Tue, 9 Dec 2008 19:57:05 -0500
- Delivered-to: eclipselink-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=JYlxoityKjlCt927sDAXNVCNcqWiIUvWsfmjaQbQlc8=; b=lm60G+TO8sSIlOYC1fVVZjQ20OeGxPTMQRpghP5EbUZBv9JR4EmZUbmLXugzvapHgQ 0Drhhwl8cKwjvEE/THLqcX1gAXGjtz0iOUGGm0Wcm0ACeneXrjbYPLr0pquVogPSEhjB ak0A1QIWBLd1ghkZcwZM7tg3emUrp6sSp1kms=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=InUP+upFfoMKW7wTrTXMP0bj+3Sl0Oc5bcn9kZ/3TfNRLSfTCfuODp5tflCXEl6rwA frjVf2Q81yJzSJ5toJKnxYkOS07fBKd30W3P+djOx+eJuvIjus/BJTEkSZiSNP9pISMJ 2Sr9w/h/ZgDz3FbLCAXvCyK1u/L/iKbUxgJVw=
Doug Clarke should be able to answer you, the osgi EMF creation can be
a moving target.
I dont have the latest build in front of me at the moment, but I wrote
the tutorial around the 1.0.1 OSGI release.
./tch
On Tue, Dec 9, 2008 at 7:50 PM, Erasmo <einundswanzig@xxxxxxxxx> wrote:
> Thanks Tom and Tim.
>
> I have seen the examples before but it looks like something has change in
> the most recent builds since i receive a:
>
> org.eclipse.persistence.config.PersistenceUnitProperties cannot be resolved.
> org.eclipse.persistence.jpa.osgi.PersistenceProvider cannot be resolved.
>
> Once i import those packages, it still says:
>
> Access restriction: the method createEntityManagerFactory(String, Map) from
> the type PersistenceProvider is not accessible due to a restriction on
> required library ...
>
> If i use the Persistence.createEntityManagerFactory(persistenceUnitName) i
> get an error saying wasn't able to load that persistence unit name. what can
> i do? Against which build was run the svn demo?
>
>
>
>
> On Mon, Dec 8, 2008 at 6:23 AM, Tim Hollosy <hollosyt@xxxxxxxxx> wrote:
>>
>> 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
>> >
>> _______________________________________________
>> 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
>
>