Orientdb Http api with ssl - orientdb

How can i use orientdb(community) http api with ssl.
i was applying this procedures. browser get this error "ssl sertificate not trusted "
https://orientdb.com/docs/2.2.x/Using-SSL-with-OrientDB.html
version 3.0.6
system : centos.
<sockets>
<socket implementation="com.orientechnologies.orient.server.network.OServerTLSSocketFactory" name="ssl">
<parameters>
<parameter value="false" name="network.ssl.clientAuth"/>
<parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore"/>
<parameter value="my password" name="network.ssl.keyStorePassword"/>
<parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore"/>
<parameter value="my password" name="network.ssl.trustStorePassword"/>
</parameters>
</socket>
<socket implementation="com.orientechnologies.orient.server.network.OServerTLSSocketFactory" name="https">
<parameters>
<parameter value="false" name="network.ssl.clientAuth"/>
<parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore"/>
<parameter value="my password" name="network.ssl.keyStorePassword"/>
<parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore"/>
<parameter value="my password" name="network.ssl.trustStorePassword"/>
</parameters>
</socket>
</sockets>
<protocols>
<protocol implementation="com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary" name="binary"/>
<protocol implementation="com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpDb" name="http"/>
</protocols>
<listeners>
<listener protocol="binary" socket="default" port-range="2424-2430" ip-address="0.0.0.0"/>
<listener protocol="http" socket="https" port-range="2434-2440" ip-address="0.0.0.0">

Related

Service Fabric StateLessService only instantiating on one node

I created a brand-new Service Fabric app with a single StatelessService. I expected the service to be instantiated on all five nodes (see my ApplicationManifest.xml file, below), but for some reason it always instantiates on Node 1. Any help in this regard would be greatly appreciated.
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="AlgoistsType" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<Parameter Name="TradeSafe_ASPNETCORE_ENVIRONMENT" DefaultValue="" />
<Parameter Name="TradeSafe_MinReplicaSetSize" DefaultValue="3" />
<Parameter Name="TradeSafe_PartitionCount" DefaultValue="1" />
<Parameter Name="TradeSafe_TargetReplicaSetSize" DefaultValue="3" />
<Parameter Name="FrontEnd_ASPNETCORE_ENVIRONMENT" DefaultValue="" />
<Parameter Name="FrontEnd_InstanceCount" DefaultValue="-1" />
</Parameters>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="TradeSafePkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<EnvironmentOverrides CodePackageRef="code">
<EnvironmentVariable Name="ASPNETCORE_ENVIRONMENT" Value="[TradeSafe_ASPNETCORE_ENVIRONMENT]" />
</EnvironmentOverrides>
</ServiceManifestImport>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="FrontEndPkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<EnvironmentOverrides CodePackageRef="code">
<EnvironmentVariable Name="ASPNETCORE_ENVIRONMENT" Value="[FrontEnd_ASPNETCORE_ENVIRONMENT]" />
</EnvironmentOverrides>
</ServiceManifestImport>
<DefaultServices>
<Service Name="FrontEnd" ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="FrontEndType" InstanceCount="[FrontEnd_InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
</ApplicationManifest>

Why can't I connect to this Service Fabric cluster?

I'm blocked by an error when connecting to a remote service fabric cluster running on premise (not on Azure) using the Connect-ServiceFabricCluster PowerShell command for a network-connected virtual machine:
WARNING: Failed to contact Naming Service. Attempting to contact Failover Manager Service...
WARNING: Failed to contact Failover Manager Service, Attempting to contact FMM...
False
WARNING: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.1.102:19000
Connect-ServiceFabricCluster : No cluster endpoint is reachable, please check if there is connectivity/firewall/DNS issue.
At Install.ps1:3 char:1
+ Connect-ServiceFabricCluster -ConnectionEndpoint "FABRICTESTSRV:19000" -WindowsCred ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricException
+ FullyQualifiedErrorId : TestClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster
The command is:
Connect-ServiceFabricCluster -ConnectionEndpoint "FABRICTESTSRV:19000" -WindowsCredential:$True
Why isn't it working?
Here is what I have tried:
I have tried turning Windows Firewall off entirely. No luck there.
Connecting locally to the cluster while inside of the virtual machine works just fine: Connect-ServiceFabricCluster "localhost:19000"
This is not a DNS issue. I can ping the FQDN of the machine just fine.
Note: This is not an Azure hosted Virtual Machine. This is simply a network-connected virtual machine running Service Fabric Core, vanilla Windows 8.1 x64 fully up to date.
Edit: Get-ServiceFabricClusterManifest reads as follows:
<ClusterManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="ComputerName-Local-Cluster" Version=
"1.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<NodeTypes>
<NodeType Name="NodeType0">
<Endpoints>
<ClientConnectionEndpoint Port="19000" />
<LeaseDriverEndpoint Port="19001" />
<ClusterConnectionEndpoint Port="19002" />
<HttpGatewayEndpoint Port="19080" Protocol="http" />
<HttpApplicationGatewayEndpoint Port="19081" Protocol="http" />
<ServiceConnectionEndpoint Port="19006" />
<ApplicationEndpoints StartPort="30001" EndPort="31000" />
</Endpoints>
</NodeType>
<NodeType Name="NodeType1">
<Endpoints>
<ClientConnectionEndpoint Port="19010" />
<LeaseDriverEndpoint Port="19011" />
<ClusterConnectionEndpoint Port="19012" />
<HttpGatewayEndpoint Port="19082" Protocol="http" />
<HttpApplicationGatewayEndpoint Port="19083" Protocol="http" />
<ServiceConnectionEndpoint Port="19016" />
<ApplicationEndpoints StartPort="31001" EndPort="32000" />
</Endpoints>
</NodeType>
<NodeType Name="NodeType2">
<Endpoints>
<ClientConnectionEndpoint Port="19020" />
<LeaseDriverEndpoint Port="19021" />
<ClusterConnectionEndpoint Port="19022" />
<HttpGatewayEndpoint Port="19084" Protocol="http" />
<HttpApplicationGatewayEndpoint Port="19085" Protocol="http" />
<ServiceConnectionEndpoint Port="19026" />
<ApplicationEndpoints StartPort="32001" EndPort="33000" />
</Endpoints>
</NodeType>
<NodeType Name="NodeType3">
<Endpoints>
<ClientConnectionEndpoint Port="19030" />
<LeaseDriverEndpoint Port="19031" />
<ClusterConnectionEndpoint Port="19032" />
<HttpGatewayEndpoint Port="19086" Protocol="http" />
<HttpApplicationGatewayEndpoint Port="19087" Protocol="http" />
<ServiceConnectionEndpoint Port="19036" />
<ApplicationEndpoints StartPort="33001" EndPort="34000" />
</Endpoints>
</NodeType>
<NodeType Name="NodeType4">
<Endpoints>
<ClientConnectionEndpoint Port="19040" />
<LeaseDriverEndpoint Port="19041" />
<ClusterConnectionEndpoint Port="19042" />
<HttpGatewayEndpoint Port="19088" Protocol="http" />
<HttpApplicationGatewayEndpoint Port="19089" Protocol="http" />
<ServiceConnectionEndpoint Port="19046" />
<ApplicationEndpoints StartPort="34001" EndPort="35000" />
</Endpoints>
</NodeType>
</NodeTypes>
<Infrastructure>
<WindowsServer IsScaleMin="true">
<NodeList>
<Node NodeName="_Node_0" IPAddressOrFQDN="localhost" IsSeedNode="true" NodeTypeRef="NodeType0" FaultDomain="fd:/0" UpgradeDomain="0" />
<Node NodeName="_Node_1" IPAddressOrFQDN="localhost" IsSeedNode="true" NodeTypeRef="NodeType1" FaultDomain="fd:/1" UpgradeDomain="1" />
<Node NodeName="_Node_2" IPAddressOrFQDN="localhost" IsSeedNode="true" NodeTypeRef="NodeType2" FaultDomain="fd:/2" UpgradeDomain="2" />
<Node NodeName="_Node_3" IPAddressOrFQDN="localhost" NodeTypeRef="NodeType3" FaultDomain="fd:/3" UpgradeDomain="3" />
<Node NodeName="_Node_4" IPAddressOrFQDN="localhost" NodeTypeRef="NodeType4" FaultDomain="fd:/4" UpgradeDomain="4" />
</NodeList>
</WindowsServer>
</Infrastructure>
<FabricSettings>
<Section Name="Security">
<Parameter Name="ClusterCredentialType" Value="None" />
<Parameter Name="ServerAuthCredentialType" Value="None" />
</Section>
<Section Name="FailoverManager">
<Parameter Name="ExpectedClusterSize" Value="4" />
<Parameter Name="TargetReplicaSetSize" Value="3" />
<Parameter Name="MinReplicaSetSize" Value="3" />
<Parameter Name="ReconfigurationTimeLimit" Value="20" />
<Parameter Name="BuildReplicaTimeLimit" Value="20" />
<Parameter Name="CreateInstanceTimeLimit" Value="20" />
<Parameter Name="PlacementTimeLimit" Value="20" />
</Section>
<Section Name="ReconfigurationAgent">
<Parameter Name="ServiceApiHealthDuration" Value="20" />
<Parameter Name="ServiceReconfigurationApiHealthDuration" Value="20" />
<Parameter Name="LocalHealthReportingTimerInterval" Value="5" />
<Parameter Name="IsDeactivationInfoEnabled" Value="true" />
<Parameter Name="RAUpgradeProgressCheckInterval" Value="3" />
</Section>
<Section Name="ClusterManager">
<Parameter Name="TargetReplicaSetSize" Value="3" />
<Parameter Name="MinReplicaSetSize" Value="3" />
<Parameter Name="UpgradeStatusPollInterval" Value="5" />
<Parameter Name="UpgradeHealthCheckInterval" Value="5" />
<Parameter Name="FabricUpgradeHealthCheckInterval" Value="5" />
</Section>
<Section Name="NamingService">
<Parameter Name="TargetReplicaSetSize" Value="3" />
<Parameter Name="MinReplicaSetSize" Value="3" />
</Section>
<Section Name="Management">
<Parameter Name="ImageStoreConnectionString" Value="file:C:\SfDevCluster\Data\ImageStoreShare" />
<Parameter Name="ImageCachingEnabled" Value="false" />
<Parameter Name="EnableDeploymentAtDataRoot" Value="true" />
</Section>
<Section Name="Hosting">
<Parameter Name="EndpointProviderEnabled" Value="true" />
<Parameter Name="RunAsPolicyEnabled" Value="true" />
<Parameter Name="DeactivationScanInterval" Value="60" />
<Parameter Name="DeactivationGraceInterval" Value="10" />
<Parameter Name="EnableProcessDebugging" Value="true" />
<Parameter Name="ServiceTypeRegistrationTimeout" Value="20" />
<Parameter Name="CacheCleanupScanInterval" Value="300" />
</Section>
<Section Name="HttpGateway">
<Parameter Name="IsEnabled" Value="true" />
</Section>
<Section Name="PlacementAndLoadBalancing">
<Parameter Name="MinLoadBalancingInterval" Value="300" />
</Section>
<Section Name="Federation">
<Parameter Name="NodeIdGeneratorVersion" Value="V4" />
<Parameter Name="UnresponsiveDuration" Value="0" />
</Section>
<Section Name="ApplicationGateway/Http">
<Parameter Name="IsEnabled" Value="true" />
</Section>
<Section Name="FaultAnalysisService">
<Parameter Name="TargetReplicaSetSize" Value="3" />
<Parameter Name="MinReplicaSetSize" Value="3" />
</Section>
<Section Name="Trace/Etw">
<Parameter Name="Level" Value="4" />
</Section>
<Section Name="Diagnostics">
<Parameter Name="ProducerInstances" Value="ServiceFabricEtlFile, ServiceFabricPerfCtrFolder" />
<Parameter Name="MaxDiskQuotaInMB" Value="10240" />
</Section>
<Section Name="ServiceFabricEtlFile">
<Parameter Name="ProducerType" Value="EtlFileProducer" />
<Parameter Name="IsEnabled" Value="true" />
<Parameter Name="EtlReadIntervalInMinutes" Value=" 5" />
<Parameter Name="DataDeletionAgeInDays" Value="3" />
</Section>
<Section Name="ServiceFabricPerfCtrFolder">
<Parameter Name="ProducerType" Value="FolderProducer" />
<Parameter Name="IsEnabled" Value="true" />
<Parameter Name="FolderType" Value="ServiceFabricPerformanceCounters" />
<Parameter Name="DataDeletionAgeInDays" Value="3" />
</Section>
<Section Name="TransactionalReplicator">
<Parameter Name="CheckpointThresholdInMB" Value="64" />
</Section>
</FabricSettings>
</ClusterManifest>
Why isn't it working?
It is not working because you set IP address of your nodes as localhost thus making them undiscoverable. It will work for local debug cluster, but for on-premises and for Azure clusters you have to specify valid and reachable IP address or qualified name.
Also, I'm not 100% sure right now, but I can suggest to specify FQDN instead of IP address if you want your cluster be accessible by URI and not by IP. I remember I had troubles with this, but it is still not clear what has helped — FQDN or something else.
There were a few issues, but the biggest, as #cassandrad mentioned, was that the default deployment binds to the TCP FQDN of localhost (IPAddressOrFQDN="localhost") and not the IP address of the machine, so it only allows local connections by default.
Here are complete steps for fixing my issue:
I first ran netstat -a | FindStr "19000" in Command Prompt to check what bindings were active, in order to affirm what #cassandrad said.
Reading this guide, I decided to download the Service Fabric standalone package for Windows Server (works just fine outside of Windows Server, on Windows 8.1 x64 by the way).
I copied and then modified ClusterConfig.Unsecure.DevCluster.json, under the nodes section I changed all nodes' iPAddress to be 192.168.1.102. I called the new file ClusterConfig.Unsecure.CustomDevCluster.json.
I ran CreateServiceFabricCluster.ps1. It asked me what JSON configuration to use, so I gave it ClusterConfig.Unsecure.DevCluster.json.
The first time it failed because of an error fetching Newtonsoft.JSON version 6.0.0.0, as visible from the traces, which was a rather annoying, obfuscated error. The error was because I did not have .NET Framework 4.6.2, so I downloaded and installed it.
The second time it failed because a Microsoft Azure Service Fabric MSI was installed. This error came up because I had previously installed MicrosoftAzure-ServiceFabric-CoreSDK.exe. I went to Programs and Features and uninstalled Microsoft Azure Service Fabric (I left the Microsoft Azure Service Fabric SDK installed).
I ran the script one last time, fingers crossed, it finally worked.
It is an unsecure cluster, so I was able to simply connect to it using Connect-ServiceFabricCluster "192.168.1.102:19000". If you want to enable other authentication mechanisms, modify and use some of the other .json sample configurations.

OrientDB Embedded and Distributed error: Distributed Storage was not installed

Hello thank you for reading this question. I have orient db set up and would like to add a second server and have them replicate between each other. When one goes on its own it runs fine and I have been using it for months. When enabling the hazelcast plugin, the servers start communicating, and I can see they start to talk to each other. An error happens when they try to write to each other though. This is the same issue discussed here:
https://groups.google.com/forum/#!topic/orient-database/QpZPG4y_KpU
For what its worth, I have both of these servers deployed on the same machine, each with their own embedded database. The database paths are plocal:/home/chris/dbs/db2 and plocal:/home/chris/dbs/db1
2015-10-08 08:56:14:048 INFO [db2-orient] Saving distributed configuration file for database 'db' to: ./databases/db/distributed-config.json [OHazelcastPlugin]
2015-10-08 08:56:14:049 INFO [db2-orient] received new status idp2-orient.idp=SYNCHRONIZING [OHazelcastPlugin]
2015-10-08 08:56:18:054 WARNING [db2-orient]->[[db1-orient]] requesting deploy of database 'db' on local server... [OHazelcastPlugin]
Then on the other server, the one that started first, I see
[OHazelcastPlugin]{db=db} [db1-orient]<-[db2-orient] error on executing distributed request 0: deploy_db
com.orientechnologies.orient.server.distributed.ODistributedException: Distributed storage was not installed for database 'db'. Implementation found: com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage
at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.executeOnLocalNode(OHazelcastPlugin.java:745)
at com.orientechnologies.orient.server.hazelcast.ODistributedWorker.onMessage(ODistributedWorker.java:298)
at com.orientechnologies.orient.server.hazelcast.ODistributedWorker.run(ODistributedWorker.java:121)
I put a breakpoint on the line that throws that exception, and the storage type present at that time is indeed OLocalPaginatedStorage. My orientDB version is 2.0.15.
My distributed config. (Same on both servers)
{
"autoDeploy": true,
"hotAlignment": false,
"executionMode": "undefined",
"readQuorum": 1,
"writeQuorum": 2,
"failureAvailableNodesLessQuorum": false,
"readYourWrites": true,
"clusters": {
"internal": {
},
"index": {
},
"*": {
"servers" : [ "<NEW_NODE>" ]
}
}
}
This is how I start my server. It is embedded, and started via a java application.
OServer server = OServerMain.create(true);
OPartitionedDatabasePool pool = server.startup(config.toString()).activate().getDatabasePoolFactory().get(dbPath, OUser.ADMIN, OUser.ADMIN);
The config the server uses to start up is this
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<orient-server>
<handlers>
<handler class="com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin">
<parameters>
<parameter name="nodeName" value="db2-orient" />
<parameter name="enabled" value="true" />
<parameter name="configuration.db.default" value="${orientDBConfigs}/orientdb-default-distributed-db-config.json" />
<parameter name="configuration.hazelcast" value="${orientDBConfigs}/orientdb-hazelcast.xml" />
<parameter name="conflict.resolver.impl" value="com.orientechnologies.orient.server.distributed.conflict.ODefaultReplicationConflictResolver" />
<parameter name="sharding.strategy.round-robin" value="com.orientechnologies.orient.server.hazelcast.sharding.strategy.ORoundRobinPartitioninStrategy" />
</parameters>
</handler>
<handler class="com.orientechnologies.orient.server.handler.OAutomaticBackup">
<parameters>
<parameter name="enabled" value="false" />
<parameter name="delay" value="4h" />
<parameter name="target.directory" value="backup" />
<parameter name="target.fileName" value="${DBNAME}-${DATE:yyyyMMddHHmmss}.json" />
<parameter name="db.include" value="" />
<parameter name="db.exclude" value="" />
</parameters>
</handler>
<handler class="com.orientechnologies.orient.server.plugin.mail.OMailPlugin">
<parameters>
<parameter name="enabled" value="false" />
<parameter name="profile.default.mail.smtp.host" value="localhost" />
<parameter name="profile.default.mail.smtp.port" value="25" />
<parameter name="profile.default.mail.smtp.auth" value="true" />
<parameter name="profile.default.mail.smtp.starttls.enable" value="true" />
<parameter name="profile.default.mail.smtp.user" value="" />
<parameter name="profile.default.mail.smtp.password" value="" />
<parameter name="profile.default.mail.date.format" value="yyyy-MM-dd HH:mm:ss" />
</parameters>
</handler>
<handler class="com.orientechnologies.orient.server.handler.OServerSideScriptInterpreter">
<parameters>
<parameter name="enabled" value="false" />
</parameters>
</handler>
</handlers>
<network>
<protocols>
<protocol name="binary" implementation="com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary" />
</protocols>
<listeners>
<listener protocol="binary" ip-address="0.0.0.0" port-range="2424-2430" />
</listeners>
<cluster>
</cluster>
</network>
<storages>
<storage name="${dbName}" path="${dbPath}" loaded-at-startup="true" />
</storages>
<users>
<user name="root" password="root" resources="*"/>
</users>
<properties>
<entry name="db.pool.min" value="1" />
<entry name="db.pool.max" value="20" />
<entry name="cache.level1.enabled" value="false" />
<entry name="cache.level1.size" value="1000" />
<entry name="cache.level2.enabled" value="true" />
<entry name="cache.level2.size" value="1000" />
<entry name="profiler.enabled" value="true" />
<entry name="log.console.level" value="info" />
<entry name="log.file.level" value="fine" />
<entry name="plugin.dynamic" value="false"/>
</properties>
Thanks again.
as wolf4ood pointed out, the storage type is replaced by the hazelcast plugin in the hazelcast plugin's onOpen method. Paginated storage gets switched to Distributed. This replacement does not happen if the path doesnt start with "plocal:./databases". Solution: make the path start with that. I have no idea if this is a good idea or not. That check seems to be in there for a reason, the comments in the code seem to indicate something about running on the same jvm.

Rollback Transaction in wso2esb 4.7.0

I'm using wso2esb 4.7.0 and postgresql and inserting values in two different tables of same database through proxy service.This insertion operation in working properly.Now my scenario is if my second insertion fails,first insertion should rollback.for that i have use transaction mediator(rollback transaction) but it is not working properly.
proxy configuration and fault sequence as follows:
<target >
<inSequence onError="myFaultHandler">
<transaction action="new"/>
<dbreport>
<connection>
<pool>
<password>Youtility11</password>
<user>youtilitydba</user>
<url>jdbx:postgresql://localhost:5432/DB2</url>
<driver>org.postgresql.Driver</driver>
</pool>
</connection>
<statement>
<sql>
insert into table1(name,id) values(?,?)</sql>
<parameter xmlns:ns="http://org.apache.synapse/xsd"
expression="//name/text()"
type="VARCHAR"/>
<parameter xmlns:ns="http://org.apache.synapse/xsd"
expression="//id/text()"
type="VARCHAR"/>
</statement>
</dbreport>
<log level="full">
<property name="name" expression="get-property('name')"/>
<property name="id" expression="get-property('id')"/>
</log>
<log level="full">
<property name="text" value="Reporting to the DB2"/>
</log>
<dbreport>
<connection>
<pool>
<password>Youtility11</password>
<user>youtilitydba</user>
<url>jdbx:postgresql://localhost:5432/DB2</url>
<driver>org.postgresql.Driver</driver>
</pool>
</connection>
<statement>
<sql>
insert into table2(firstname,lastname) values(?,?)</sql>
<parameter xmlns:ns="http://org.apache.synapse/xsd"
expression="//firstname/text()"
type="VARCHAR"/>
<parameter xmlns:ns="http://org.apache.synapse/xsd"
expression="//lastname/text()"
type="VARCHAR"/>
</statement>
</dbreport>
</inSequence>
</target>
and sequence is:
<sequence xmlns="http://ws.apache.org/ns/synapse" name="myFaultHandler">
<log level="full">
<property name="message" value="**ROLLBACK**"/>
</log>
<transaction action="rollback"/>
</sequence>
here when i'm inserting wrong record in second table it shows error but first table insertion is done.why rollback is not working? let me know..
thanks in advance

Transaction mediator in wso2esb 4.8.0

I'm working with wso2esb 4.8.0 and i go through this scenario which is given in wso2esb documentation.I want to copy the records from first database to second database as soon as i delete them from first database.but when i put the duplicate record it should neither delete from first nor insert into second.
my proxy service :
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="Transaction_mediator"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="name"
expression="//name/text()"
scope="default"
type="STRING"/>
<property name="id"
expression="//id/text()"
scope="default"
type="STRING"/>
<property name="price"
expression="//price/text()"
scope="default"
type="STRING"/>
<transaction action="new"/>
<log level="full">
<property name="text" value="Reporting to the DB1"/>
</log>
<dbreport useTransaction="true">
<connection>
<pool>
<dsName>DS1</dsName>
</pool>
</connection>
<statement>
<sql>
delete from c1 where name=?</sql>
<parameter expression="get-property('name')" type="VARCHAR"/>
</statement>
</dbreport>
<log level="full">
<property name="text" value="Reporting to the DB2"/>
</log>
<dbreport useTransaction="true">
<connection>
<pool>
<dsName>DS2</dsName>
</pool>
</connection>
<statement>
<sql>
INSERT into c1 values (?,?,?)</sql>
<parameter expression="get-property('name')" type="VARCHAR"/>
<parameter expression="get-property('id')" type="INTEGER"/>
<parameter expression="get-property('price')" type="INTEGER"/>
</statement>
</dbreport>
<transaction action="commit"/>
<send/>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
</target>
<description/>
</proxy>
It's working but error occurred when i put duplicate records.At that time It deleting records from first but not inserting into second database.What should i do?is their any solution?let me know.
There is an issue with transaction mediator with JDBC and it has been reported in the wso2 esb issue tracker. Therefore, this may be fixed in feature releases.