Friday, March 24, 2017

WebLogic : Controlling Multi Data Source Failover with a Callback

Here the schema http://xmlns.oracle.com/weblogic/jdbc-data-source/1.5/jdbc-data-source.xsd

and here the documentation : https://docs.oracle.com/cd/E24329_01/web.1211/e24367/jdbc_multidatasources.htm#JDBCA209

"The name of the application class to handle the callback sent when a multi data source is ready to failover or fail back connection requests to another data source within the multi data source. The name must be the absolute name of an application class that implements the weblogic.jdbc.extensions.ConnectionPoolFailoverCallback interface."



Monday, March 20, 2017

Book review: The rise of the Robots

https://www.amazon.com/Rise-Robots-Technology-Threat-Jobless/dp/0465097537



The book is excellent. Read it. Then you will be really scared about the future, and I mean the next 10-20 years. Because it's going to be a very quick process the one putt us all out of work. Unless you belong to a very selected elite of super-engineers dedicated to AI processes. Or someone like a surgeon or medical doctor who HAS to be present to a process to give some accountability.

I have read the book and felt really frightened. No matter how hard one studies, s/he will never be able to compete with a machine.

Nevertheless life goes on and I keep studying. More for personal pride and curiosity. Anyway in 9 years I will be 65 inshallah and hope to retire...



LoggingLastResource

If you use a LoggingLastResource Datasource, you must specify a table with the tag jdbcllr-table-name in config.xml.

We did that and we got

"javax.transaction.SystemException: Failed to call registerLoggingResourceTransactions() weblogic.transaction.loggingresource.LoggingResourceException: weblogic.transaction.loggingresource.LoggingResourceException: java.sql.SQLException: JDBC LLR, table verify failed for table 'WL_LLR_PIPPO_7436', failed to create table"

I have enabled the flags

-Dweblogic.debug.DebugJDBCSQL=true -Dweblogic.log.StdoutSeverity=Debug -Dweblogic.StdoutDebugEnabled=true

and discovered this

[weblogic.jdbc.wrapper.Statement_oracle_jdbc_driver_OracleStatementWrapper@4] 
executeUpdate(CREATE TABLE WL_LLR_PIPPO_7436 (XIDSTR VARCHAR(40) NOT NULL PRIMARY KEY, POOLNAMESTR VARCHAR(64), RECORDSTR VARCHAR(1000))) 
throws java.sql.SQLSyntaxErrorException: ORA-01031: insufficient privileges

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:30)
        at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:931)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1150)
        at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1707)
        at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1670)
        at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:310)
        at weblogic.jdbc.wrapper.Statement.executeUpdate(Statement.java:535)
        at weblogic.jdbc.wrapper.JTSLoggableResourceTable.createTable(JTSLoggableResourceTable.java:234)
        at weblogic.jdbc.wrapper.JTSLoggableResourceTable.findOrCreateTable(JTSLoggableResourceTable.java:287)
        at weblogic.jdbc.wrapper.JTSLoggableResourceImpl.findOrCreateBackingTable(JTSLoggableResourceImpl.java:530)




so you can simply ask the DBA to create the table, or grant you CREATE TABLE privileges.