При сохранить изменения в таблице через Oracle SQL Developer получается ошибка:
One error saving changes to table "SCHEMA"."TABLENAME":
Row 1: Data got commited in another/same session, cannot update row.
Вариант решения: One error saving changes to table "SCHEMA"."TABLENAME":
Row 1: Data got commited in another/same session, cannot update row.
Вариант решения: java.lang.UnsupportedOperationException: Remote JDBC disabled
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
at weblogic.jdbc.common.internal.RmiDataSource_1036_WLStub.getConnection(Unknown Source)
at oracle.integration.platform.blocks.event.saq.SAQRemoteBusinessEventConnection.createConnection(SAQRemoteBusinessEventConnection.java:122)
at oracle.integration.platform.blocks.event.saq.SAQRemoteBusinessEventConnection.enqueueEvent(SAQRemoteBusinessEventConnection.java:67)
at oracle.integration.platform.blocks.event.saq.SAQRemoteBusinessEventConnection.publishEvent(SAQRemoteBusinessEventConnection.java:54)
...
Caused by: java.lang.UnsupportedOperationException: Remote JDBC disabled
at weblogic.jdbc.common.internal.JDBCServerHelperImpl.<clinit>(JDBCServerHelperImpl.java:50)
at weblogic.jdbc.common.internal.JDBCService.initialize(JDBCService.java:91)
at weblogic.jdbc.common.internal.JDBCService.start(JDBCService.java:138)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Причина: ...
WLS_JDBC_REMOTE_ENABLED="-Dweblogic.jdbc.remoteEnabled=true"
export WLS_JDBC_REMOTE_ENABLED
...
-Dweblogic.jdbc.remoteEnabled=true
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://schemas.oracle.com/events/edl" targetNamespace="http://schemas.oracle.com/events/edl/TestEvent">
<schema-import namespace="http://nl.xenta/events" location="xsd/TestEvent.xsd"/>
<event-definition name="EventElement">
<content xmlns:ns0="http://nl.xenta/events" element="ns0:TestEvent"/>
</event-definition>
</definitions>
По-умолчанию используется механизм AQ, но можно настроить и с использованием JMS (см. 41.3.6 How to Configure JMS-based EDN Implementations)
import oracle.fabric.blocks.event.BusinessEventConnection;
import oracle.fabric.blocks.event.BusinessEventConnectionFactory;
import oracle.integration.platform.blocks.event.BusinessEventBuilder;
import oracle.integration.platform.blocks.event.jms.JmsRemoteBusinessEventConnectionFactory;
import oracle.integration.platform.blocks.event.saq.SAQRemoteBusinessEventConnectionFactory;
import oracle.soa.common.util.XMLUtil;
import org.w3c.dom.Element;
import java.util.Date;
import java.util.Properties;
import javax.jms.Queue;
import javax.jms.QueueConnectionFactory;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import javax.transaction.UserTransaction;
import javax.xml.namespace.QName;
public class EdnUtils {
private static final String EDN_JMS_CONNECTION_FACTORY_NAME = "jms/fabric/EDNConnectionFactory";
private static final String EDN_JMS_XA_CONNECTION_FACTORY_NAME = "jms/fabric/xaEDNConnectionFactory";
private static final String EDN_QUEUE_NAME = "jms/fabric/EDNQueue";
private static final String EDN_DATASOURCE = "jdbc/EDNDataSource";
private static final String EDN_LOCALTX_DATASOURCE = "jdbc/EDNLocalTxDataSource";
public static void main(String[] args) {
Properties props = new Properties();
props.put(Context.PROVIDER_URL, "t3://127.0.0.1:8001");
props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
props.put(Context.SECURITY_PRINCIPAL, "weblogic");
props.put(Context.SECURITY_CREDENTIALS, "welcome1");
try{
String eventName = "EventElement";
String eventNamespace = "http://schemas.oracle.com/events/edl/TestEvent";
String eventBodyStr = "<TestEvent xmlns=\"http://nl.xenta/events\">\n"
+ "<action>action from java</action> \n"
+ "<description>description at [" + new Date() + "]</description> \n"
+ "</TestEvent>";
Element eventBody = XMLUtil.parseDocumentFromXMLString(eventBodyStr.toString()).getDocumentElement();
InitialContext context = new InitialContext(props);
EdnUtils.publishEvent(context, false, eventName, eventNamespace, eventBody);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void publishEvent(InitialContext context, boolean isJmsEdnMode, String eventName,
String eventNamespace, Element eventBody) throws NamingException {
BusinessEventConnectionFactory factory = null;
UserTransaction userTransaction =
(UserTransaction) context.lookup("javax.transaction.UserTransaction");
if (!isJmsEdnMode) {
DataSource ds = (DataSource) context.lookup(EDN_DATASOURCE);
DataSource localTxDs = (DataSource) context.lookup(EDN_LOCALTX_DATASOURCE);
factory = new SAQRemoteBusinessEventConnectionFactory(ds, localTxDs, userTransaction);
} else {
QueueConnectionFactory queueConnectionFactory =
((QueueConnectionFactory) context.lookup(EDN_JMS_CONNECTION_FACTORY_NAME));
QueueConnectionFactory xaQueueConnectionFactory =
((QueueConnectionFactory) context.lookup(EDN_JMS_XA_CONNECTION_FACTORY_NAME));
Queue jmsQueue = ((Queue) context.lookup(EDN_QUEUE_NAME));
factory = new JmsRemoteBusinessEventConnectionFactory(queueConnectionFactory, xaQueueConnectionFactory,
jmsQueue, userTransaction);
}
BusinessEventConnection conn = factory.createBusinessEventConnection();
BusinessEventBuilder builder = BusinessEventBuilder.newInstance();
builder.setEventName(new QName(eventNamespace, eventName));
builder.setBody(eventBody);
conn.publishEvent(builder.createEvent(), 3);
conn.close();
}
}
Для сборки и запуска примера из JDeveloper потребуются следующие библиотеки:
<bpelFault>
<faultType>0</faultType>
<subLanguageExecutionFault xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
<part name="summary">
<summary>An error occurs while processing the XPath expression; the
expression is oraext:query-database("select
max(salary) from employee",false(),false(),'jdbc/examplesDS').</summary>
</part>
<part name="detail">
<detail>XPath expression failed to execute. An error occurs while
processing the XPath expression; the expression is
oraext:query-database("select max(salary) from
employee",false(),false(),'jdbc/examplesDS'). The XPath
expression failed to execute; the reason was: internal xpath
error. Check the detailed root cause described in the exception
message text and verify that the XPath query is correct.</detail>
</part>
<part name="code">
<code>XPath expression failed to execute</code>
</part>
</subLanguageExecutionFault>
</bpelFault>
А в логе managed-сервера:
oracle.xml.sql.OracleXMLSQLException: Character ')' is not allowed in an XML tag name.
at oracle.xml.sql.core.OracleXMLConvert.getXML(OracleXMLConvert.java:1178)
at oracle.xml.sql.query.OracleXMLQuery.getXMLDOM(OracleXMLQuery.java:417)
at oracle.xml.sql.query.OracleXMLQuery.getXMLDOM(OracleXMLQuery.java:384)
at oracle.xml.sql.query.OracleXMLQuery.getXMLDOM(OracleXMLQuery.java:345)
at oracle.tip.pc.services.functions.ExtFunc.queryDatabase(ExtFunc.java:152)
at oracle.tip.pc.services.functions.ExtFuncFunction$QueryDatabaseFunction.call(ExtFuncFunction.java:359)
...
Причина: oraext:query-database("select max(salary) as salary from employee",
false(),false(),'jdbc/examplesDS')