|
Re: [CDO/Hibernate] Examples: Why Query with CDOTransaction and not CDOView? [message #899575 is a reply to message #899553] |
Wed, 01 August 2012 13:44 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Christoph,
No special reason, thanks for the note ecore.change, I hope to spend time on CDO Hibernate Store in august and solve
this and some other issues.
gr. Martin
On 08/01/2012 02:05 PM, Christoph Keimel wrote:
> Hello
>
> I have been studing the example projects org.eclipse.emf.cdo.examples.hibernate.*. I noticed that the queries in
> HibernateQueryTest are always created through a CDOTransaction.
> public void testSimpleQueries() throws Exception
> {
> CDOSession session = openSession();
> CDOTransaction transaction = session.openTransaction();
> {
> CDOQuery cdoQuery = transaction.createQuery("hql", "from Product"); //$NON-NLS-1$ //$NON-NLS-2$
> final List<Product> products = cdoQuery.getResult(Product.class);
> assertEquals(NUM_OF_PRODUCTS, products.size());
> }
> ...
> transaction.commit();
> }
> From the documentation I would have expected a CDOView to be used. Is there a special reason to use a CDOTransaction in
> this scenario? I.e. is it necessary to commit the selection because the objects are locked in some way or to free the
> query for garbage collection?
>
> Greetings
> Christoph
>
> P.S. I needed to add org.eclipse.emf.ecore.change to the manifest of org.eclipse.emf.cdo.examples.hibernate.client for
> the tests to run.
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
|
Powered by
FUDForum. Page generated in 0.03585 seconds