2014-05-14 11:38 GMT+01:00 GESCONSULTOR - Óscar Bou <o....@gesconsultor.com>
:

> Hi, Erik.
>
> Perhaps DN holds them still "in memory" and has not been flushed to the
> database.
>
>
I don't think that DN does, but Isis certainly does holds them in memory
until the flush or commit.


Dan




> Normally, it can be done by calling "flush" on the DomainContainer,
> similar to:
>
> this.getContainer().flush();
>
>
> HTH,
>
> Oscar
>
>
>
>
>
>
> El 14/05/2014, a las 12:27, Erik de Hair <e...@pocos.nl> escribió:
>
>
> Hi,
>
> I'm writing a test with some inserts in the @Before and a query to find
> the inserted objects (ResellerPortalIntegTest is the original
> SimpleIntegTest-class):
>
> public class ContactsTest extends ResellerPortalIntegTest {
>
>    private Role role;
>
>    private final String uniqueEmail = 
> "j...@pokos.nl"<mailto:j...@pokos.nl<j...@pokos.nl>
> >;
>    private final String duplicateEmail = "ma...@pokos.nl"<
> mailto:ma...@pokos.nl <ma...@pokos.nl>>;
>    private final String unkownEmail = "xyz...@bladiblah.com"<
> mailto:xyz...@bladiblah.com <xyz...@bladiblah.com>>;
>
>    @Before
>    public void setUp(){
>        this.role = container().newTransientInstance(Role.class);
>        this.role.setLabel("ROLE_ADMIN");
>        this.role.setDescription("(Reseller) admin");
>        container().persistIfNotAlready(this.role);
>
>        service(Contacts.class).create("Piet", "van de", "Pet",
> Gender.MALE, "p...@pokos.nl"<mailto:p...@pokos.nl <p...@pokos.nl>>,
> "pietmetpet", this.role);
>        service(Contacts.class).create("Jan", "van de", "Jas", Gender.MALE,
> this.uniqueEmail, "janvandejas", this.role);
>        service(Contacts.class).create("Marie", "van de", "Markt",
> Gender.FEMALE, this.duplicateEmail, "marievandemarkt", this.role);
>        service(Contacts.class).create("Marie", "van de", "Markt",
> Gender.FEMALE, this.duplicateEmail, "marievandemarkt1", this.role);
>    }
>
>    @Test
>    public void testFindUseraccountsByEmail() throws Exception {
>        int expected = 1;
>        int actual =
> wrap(service(Contacts.class)).findUseraccountsByEmail(this.uniqueEmail).size();
>        Assert.assertEquals(expected, actual);
>    }
> }
>
> The actual value is '0' while I'm sure the requested object is inserted by
> the @Before-method and the query is all right.
>
> Is this an Isis issue or do I have to look for a Datanucleus/other
> solution?
>
> Thanks,
> Erik
>
>
>
> Óscar Bou Bou
> Responsable de Producto
> Auditor Jefe de Certificación ISO 27001 en BSI
> CISA, CRISC, APMG ISO 20000, ITIL-F
>
>    902 900 231 / 620 267 520
>    http://www.twitter.com/oscarbou
>
>    http://es.linkedin.com/in/oscarbou
>
>    http://www.GesConsultor.com <http://www.gesconsultor.com/>
>
>
>
> Este mensaje y los ficheros anexos son confidenciales. Los mismos
> contienen información reservada que no puede ser difundida. Si usted ha
> recibido este correo por error, tenga la amabilidad de eliminarlo de su
> sistema y avisar al remitente mediante reenvío a su dirección electrónica;
> no deberá copiar el mensaje ni divulgar su contenido a ninguna persona.
> Su dirección de correo electrónico junto a sus datos personales constan en
> un fichero titularidad de Gesdatos Software, S.L. cuya finalidad es la de
> mantener el contacto con Ud. Si quiere saber de qué información disponemos
> de Ud., modificarla, y en su caso, cancelarla, puede hacerlo enviando un
> escrito al efecto, acompañado de una fotocopia de su D.N.I. a la siguiente
> dirección: Gesdatos Software, S.L. , Paseo de la Castellana, 153 bajo -
> 28046 (Madrid), y Avda. Cortes Valencianas num. 50, 1ºC - 46015 (Valencia).
> Asimismo, es su responsabilidad comprobar que este mensaje o sus archivos
> adjuntos no contengan virus informáticos, y en caso que los tuvieran
> eliminarlos.
>
>
>
>
>
>

Reply via email to