Skip to content

Commit

Permalink
Merge branch '3.9' of https://github.com/JumpMind/symmetric-ds.git in…
Browse files Browse the repository at this point in the history
…to 3.9
  • Loading branch information
chenson42 committed Jun 1, 2018
2 parents ae443c0 + 9c6100b commit c40f3cd
Show file tree
Hide file tree
Showing 53 changed files with 1,595 additions and 240 deletions.
Expand Up @@ -28,7 +28,7 @@
public class AndroidClusterService extends ClusterService {

public AndroidClusterService(IParameterService parameterService, ISymmetricDialect dialect, INodeService nodeService) {
super(parameterService, dialect, nodeService);
super(parameterService, dialect, nodeService, null);
}

@Override
Expand Down
Expand Up @@ -362,4 +362,8 @@ protected <T> T get(Cursor cursor, Class<T> clazz, int columnIndex) {
return (T) result;
}

@Override
public boolean isDataTruncationViolation(Throwable ex) {
return false;
}
}
2 changes: 1 addition & 1 deletion symmetric-assemble/common.gradle
Expand Up @@ -233,7 +233,7 @@ subprojects { subproject ->
// javax.resource needed by jaybird
provided "org.apache.geronimo.specs:geronimo-j2ee-connector_1.6_spec:1.0"
provided "com.datastax.cassandra:cassandra-driver-core:3.1.4"

provided "nl.cad:tps-parse:1.0.15-SNAPSHOT"

testCompile fileTree(dir: System.getProperty("user.home") + '/.symmetricds/lib', include: '*.jar')
testCompile "junit:junit:$junitVersion"
Expand Down
8 changes: 5 additions & 3 deletions symmetric-assemble/src/asciidoc/configuration/license-key.ad
Expand Up @@ -2,17 +2,19 @@
=== License Key

The web console requires a valid license key before it will allow access to screens.
The user is prompted automatically to enter a valid license if one is missing, or it can updated from the configuration screen.
The license key contains a group of fields to define how the software is licensed for use.
The user is prompted automatically to enter a valid license key if one is missing.
The license key can also be updated from the Configure License screen.

License Info:: A description of the license type.
Holder:: The company name or email address of the license holder.
Effective Date:: Date and time when the license will become valid.
Expiration Date:: Date and time when the license will no longer be valid.
Max Maintenance:: The end date and time for maintenance and support. Defaults to expiration date if not present.
Max Nodes:: The maximum number of nodes that can be created for synchronization.
Max Tables:: The maximum number of table triggers that can be created for synchronization.
Max Rows:: The maximum number of rows that can be synchronized in a 24-hour period.
Max Maintenance:: The end date and time for maintenance and support. Defaults to expiration date if not present.
Instance ID:: If present in the license key, this unique identifier must match the installation. If not present, the instance ID for the current installation is shown in parentheses.


The license key is a block of encoded text that is sent to the user over email, or it can be retrieved from the
http://support.jumpmind.com/[Support Center]. When an installed license key expires, the web console
Expand Down
29 changes: 24 additions & 5 deletions symmetric-assemble/src/asciidoc/configuration/transforms/types.ad
Expand Up @@ -239,13 +239,32 @@ Some variables are provided to the script:
.Variables
|===

|_COLUMN_NAME_|The variable name is the source column name in uppercase of the row being changed (replace COLUMN_NAME with your column)
|_<COLUMN_NAME>_|The variable name is the source column name in uppercase of the row being changed (replace <COLUMN_NAME> with your column)
|currentValue|The value of the current source column
|oldValue|The old value of the source column for an updated row
|sqlTemplate|a org.jumpmind.db.sql.ISqlTemplate object for querying or updating the database
|channelId|a reference to the channel on which the transformation is happening
|sourceNode|a org.jumpmind.symmetric.model.Node object that represents the node from where the data came
|targetNode|a org.jumpmind.symmetric.model.Node object that represents the node where the data is being loaded.
|sqlTemplate| org.jumpmind.db.sql.ISqlTemplate object for querying or updating the database
|channelId| name of the channel on which the transformation is happening
|sourceNode| org.jumpmind.symmetric.model.Node object that represents the node from where the data came
|sourceNodeId|same as sourceNode.getNodeId()
|sourceNodeGroupId|same as sourceNode.getNodeGroupId()
|sourceNodeExternalId|same as sourceNode.getNodeExternalId()
|targetNode| org.jumpmind.symmetric.model.Node object that represents the node where the data is being loaded.
|targetNodeId|same as targetNode.getNodeId()
|targetNodeGroupId|same as targetNode.getNodeGroupId()
|targetNodeExternalId|same as targetNode.getNodeExternalId()
|transformColumn| org.jumpmind.symmetric.io.data.transform.TransformColumn that is the transform configuration
|includeOn| org.jumpmind.symmetric.io.data.transform.TransformColumn.IncludeOnType, same as transformColumn.getIncludeOn(), tells whether column transform is configured for all, insert, update, or delete
|sourceSchemaName | source schema name that the transform matched
|sourceCatalogName | source catalog name that the transform matched
|sourceTableName | source table name that the transform matched
|transformedData | org.jumpmind.symmetric.io.data.transform.TransformedData, the model object representing the outputted transformed data
|sourceDmlType| org.jumpmind.symmetric.io.data.DataEventType that is the source row change type, either insert, update, or delete
|sourceDmlTypeString| same as sourceDmlType.toString(), returning insert, update, or delete
|log | org.slf4j.Logger, write to the log file
|context | org.jumpmind.symmetric.io.data.DataContext containing internal variables and also acts like a Map for sharing variables between transforms for the current sync session
|bshContext | java.util.Map, static map of variables to share between transforms
|engine | org.jumpmind.symmetric.ISymmetricEngine, access to engine functions and services


|===

Expand Down
Expand Up @@ -45,6 +45,7 @@
import org.jumpmind.db.platform.DatabaseNamesConstants;
import org.jumpmind.db.platform.IDatabasePlatform;
import org.jumpmind.db.platform.JdbcDatabasePlatformFactory;
import org.jumpmind.db.platform.cassandra.CassandraPlatform;
import org.jumpmind.db.platform.generic.GenericJdbcDatabasePlatform;
import org.jumpmind.db.sql.JdbcSqlTemplate;
import org.jumpmind.db.sql.LogSqlBuilder;
Expand Down Expand Up @@ -311,6 +312,12 @@ public static IDatabasePlatform createDatabasePlatform(ApplicationContext spring
DataSource dataSource, boolean waitOnAvailableDatabase, boolean isLoadOnly) {
log.info("Initializing connection to database");
if (dataSource == null) {
if (isLoadOnly) {
String dbUrl = properties.get(BasicDataSourcePropertyConstants.DB_POOL_URL);
if (dbUrl != null && dbUrl.startsWith("cassandra://")) {
return new CassandraPlatform(createSqlTemplateSettings(properties), dbUrl.substring(12));
}
}
String jndiName = properties.getProperty(ParameterConstants.DB_JNDI_NAME);
if (StringUtils.isNotBlank(jndiName)) {
try {
Expand Down
Expand Up @@ -22,18 +22,23 @@

import static org.apache.commons.lang.StringUtils.isBlank;

import java.io.IOException;
import java.text.ParseException;
import java.util.Date;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;
import org.jumpmind.db.model.Database;
import org.jumpmind.db.model.IndexColumn;
import org.jumpmind.db.model.NonUniqueIndex;
import org.jumpmind.db.model.Table;
import org.jumpmind.db.platform.IDatabasePlatform;
import org.jumpmind.db.platform.PermissionType;
import org.jumpmind.db.sql.ISqlTransaction;
import org.jumpmind.db.sql.SqlException;
import org.jumpmind.db.util.BinaryEncoding;
import org.jumpmind.symmetric.common.ParameterConstants;
import org.jumpmind.symmetric.common.TableConstants;
import org.jumpmind.symmetric.db.AbstractSymmetricDialect;
import org.jumpmind.symmetric.db.ISymmetricDialect;
import org.jumpmind.symmetric.db.SequenceIdentifier;
Expand Down Expand Up @@ -207,6 +212,21 @@ public void createRequiredDatabaseObjects() {
+ " END $(functionName); ";
install(sql, wkt2geom);
}

boolean isNoOrder = parameterService.is(ParameterConstants.DBDIALECT_ORACLE_SEQUENCE_NOORDER, false);
String seqName = getSequenceName(SequenceIdentifier.DATA).toUpperCase();
String orderFlag = platform.getSqlTemplate().queryForString(
"select order_flag from user_sequences where sequence_name = ?", seqName);
String sql = null;
if (orderFlag != null && orderFlag.equals("N") && !isNoOrder) {
sql = "alter sequence " + seqName + " order";
} else if (orderFlag != null && orderFlag.equals("Y") && isNoOrder) {
sql = "alter sequence " + seqName + " noorder";
}
if (sql != null) {
log.info("DDL applied: " + sql);
platform.getSqlTemplate().update(sql);
}
}

@Override
Expand Down Expand Up @@ -370,4 +390,20 @@ public PermissionType[] getSymTablePermissions() {
PermissionType[] permissions = { PermissionType.CREATE_TABLE, PermissionType.DROP_TABLE, PermissionType.CREATE_TRIGGER, PermissionType.DROP_TRIGGER, PermissionType.EXECUTE};
return permissions;
}

@Override
protected Database readDatabaseFromXml(String resourceName) throws IOException {
Database database = super.readDatabaseFromXml(resourceName);
if (parameterService.is(ParameterConstants.DBDIALECT_ORACLE_SEQUENCE_NOORDER, false)) {
Table table = database.findTable(TableConstants.SYM_DATA);
if (table != null) {
NonUniqueIndex index = new NonUniqueIndex("idx_crt_tm_dt_d");
index.addColumn(new IndexColumn(table.findColumn("create_time")));
index.addColumn(new IndexColumn(table.findColumn("data_id")));
table.addIndex(index);
}
}
return database;
}

}

0 comments on commit c40f3cd

Please sign in to comment.