Search in sources :

Example 1 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class TopLinkBatchUpdatesTestModel method addForcedRequiredSystems.

@Override
public void addForcedRequiredSystems() {
    DatabasePlatform platform = getSession().getPlatform();
    wasBatchWriting = platform.usesBatchWriting();
    wasJDBCBatchWriting = platform.usesJDBCBatchWriting();
    wasParameterBinding = getSession().getLogin().shouldBindAllParameters();
    try {
        getSession().getLog().write("WARNING, some JDBC drivers may fail BatchUpdates.");
    } catch (java.io.IOException e) {
    }
    if (platform.isSybase() || platform.isSQLAnywhere() || platform.isOracle() || platform.isSQLServer() || platform.isAttunity()) {
        platform.setUsesBatchWriting(true);
        // Test TopLink batch Writing
        platform.setUsesJDBCBatchWriting(false);
        platform.setMaxBatchWritingSize(3200);
        // Note: Batch writing does work in Oracle now, as of 9.0.1.
        getSession().getLogin().dontBindAllParameters();
    } else {
        throw new TestWarningException("TopLink batch writing is not supported on this database.");
    }
    getExecutor().removeConfigureSystem(new EmployeeSystem());
    // Force the database to be recreated to ensure the sequences are defined.
    addForcedRequiredSystem(new EmployeeSystem());
}
Also used : EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 2 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class StressThreeTierTest method test.

@Override
public void test() {
    Server server = null;
    try {
        server = new Project(getSession().getDatasourceLogin()).createServerSession();
        new EmployeeSystem().addDescriptors(server);
        server.addConnectionPool("default", getSession().getDatasourceLogin(), 3, 5);
        server.useReadConnectionPool(3, 3);
        server.login();
        long startTime = System.currentTimeMillis();
        ClientThread client = new ClientThread(server);
        client.start();
        try {
            client.join();
        } catch (InterruptedException exception) {
            throw new TestErrorException(exception.toString());
        }
        long endTime = System.currentTimeMillis();
        System.out.println("Single thread total time -> " + (endTime - startTime));
        ClientThread[] clients = new ClientThread[stressLevel];
        for (int i = 0; i < stressLevel; i++) {
            clients[i] = new ClientThread(server);
        }
        startTime = System.currentTimeMillis();
        for (int i = 0; i < stressLevel; i++) {
            clients[i].start();
        }
        for (int i = 0; i < stressLevel; i++) {
            try {
                clients[i].join();
            } catch (InterruptedException exception) {
                throw new TestErrorException(exception.toString());
            }
        }
        endTime = System.currentTimeMillis();
        System.out.println("Concurrent thread total time -> " + (endTime - startTime));
    } finally {
        server.logout();
    }
}
Also used : Project(org.eclipse.persistence.sessions.Project) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 3 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class ComplexUpdateAndUnitOfWorkTestModel method addRequiredSystems.

@Override
public void addRequiredSystems() {
    addRequiredSystem(new OwnershipSystem());
    addRequiredSystem(new IndirectListSystem());
    addRequiredSystem(new EmployeeSystem());
    addRequiredSystem(new InsuranceSystem());
    addRequiredSystem(new org.eclipse.persistence.testing.models.mapping.MappingSystem());
    addRequiredSystem(new org.eclipse.persistence.testing.tests.unitofwork.UOWSystem());
    addRequiredSystem(new InheritanceSystem());
}
Also used : InsuranceSystem(org.eclipse.persistence.testing.models.insurance.InsuranceSystem) InheritanceSystem(org.eclipse.persistence.testing.models.inheritance.InheritanceSystem) IndirectListSystem(org.eclipse.persistence.testing.models.transparentindirection.IndirectListSystem) org.eclipse.persistence.testing.tests.unitofwork(org.eclipse.persistence.testing.tests.unitofwork) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 4 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class DistributedServersModel method addRequiredSystems.

@Override
public void addRequiredSystems() {
    addRequiredSystem(new EmployeeSystem());
    addRequiredSystem(new DistributedSystem());
    addRequiredSystem(new org.eclipse.persistence.testing.tests.unitofwork.UOWSystem());
    // cr 4080
    addRequiredSystem(new org.eclipse.persistence.testing.models.aggregate.AggregateSystem());
}
Also used : EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 5 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class CustomSQLTestModel method addForcedRequiredSystems.

/**
 * This sets the custom SQL for the populate.
 */
@Override
public void addForcedRequiredSystems() {
    getExecutor().removeConfigureSystem(new EmployeeSystem());
    // Force the database to be recreated using custom SQL.
    addForcedRequiredSystem(new EmployeeCustomSQLSystem());
    if (getSession().getPlatform().isOracle()) {
        addForcedRequiredSystem(new InsuranceORStoredProcedureSystem());
    }
    // Force field names to upper case for custom SQL tests on postgres.
    if (getSession().getPlatform().isPostgreSQL()) {
        getSession().getPlatform().setShouldForceFieldNamesToUpperCase(true);
    }
}
Also used : EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Aggregations

EmployeeSystem (org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)28 InheritanceSystem (org.eclipse.persistence.testing.models.inheritance.InheritanceSystem)8 InsuranceSystem (org.eclipse.persistence.testing.models.insurance.InsuranceSystem)7 DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)5 DatabaseLogin (org.eclipse.persistence.sessions.DatabaseLogin)2 EventHookSystem (org.eclipse.persistence.testing.models.events.EventHookSystem)2 OwnershipSystem (org.eclipse.persistence.testing.models.ownership.OwnershipSystem)2 IndirectListSystem (org.eclipse.persistence.testing.models.transparentindirection.IndirectListSystem)2 org.eclipse.persistence.testing.tests.unitofwork (org.eclipse.persistence.testing.tests.unitofwork)2 ClassDescriptor (org.eclipse.persistence.descriptors.ClassDescriptor)1 EclipseLinkException (org.eclipse.persistence.exceptions.EclipseLinkException)1 DatabasePlatform (org.eclipse.persistence.internal.databaseaccess.DatabasePlatform)1 DatabaseSessionImpl (org.eclipse.persistence.internal.sessions.DatabaseSessionImpl)1 ForeignReferenceMapping (org.eclipse.persistence.mappings.ForeignReferenceMapping)1 ManyToManyMapping (org.eclipse.persistence.mappings.ManyToManyMapping)1 OneToOneMapping (org.eclipse.persistence.mappings.OneToOneMapping)1 TimesTenPlatform (org.eclipse.persistence.platform.database.TimesTenPlatform)1 Project (org.eclipse.persistence.sessions.Project)1 SessionBroker (org.eclipse.persistence.sessions.broker.SessionBroker)1 XMLSessionConfigLoader (org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader)1