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());
}
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();
}
}
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());
}
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());
}
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);
}
}
Aggregations