users@glassfish.java.net

Re: JUnit tests with Glassfish EJB's

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Wed, 24 Mar 2010 15:08:39 -0700

Yes, I can reproduce it with my test as well. The transaction doesn't seem to be
active when checked by EclipseLink. Can you file a bug?

thanks,
-marina

glassfish_at_javadesktop.org wrote:
> Sorry but that's not the case.
>
> My persistence.xml looks like this:
>
> [code]
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="2.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_2_0.xsd">
> <persistence-unit name="testPU" transaction-type="JTA">
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> <jta-data-source>jdbc/sample</jta-data-source>
> <properties>
> <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
> </properties>
> </persistence-unit>
> </persistence>
> [/code]
>
> So the drop-and-create-tables option should clean the database for every test.
>
> Besides I'm getting the following exception there:
>
> javax.persistence.NoResultException: getSingleResult() did not retrieve any entities.
> [Message sent by forum member 'walec51']
>
> http://forums.java.net/jive/thread.jspa?messageID=393436
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>