Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 13024 invoked from network); 12 May 2010 20:52:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 May 2010 20:52:27 -0000 Received: (qmail 74560 invoked by uid 500); 12 May 2010 20:52:27 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 74457 invoked by uid 500); 12 May 2010 20:52:27 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 74450 invoked by uid 99); 12 May 2010 20:52:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 May 2010 20:52:27 +0000 X-ASF-Spam-Status: No, hits=-2.7 required=10.0 tests=AWL,RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [32.97.110.154] (HELO e36.co.us.ibm.com) (32.97.110.154) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 May 2010 20:52:18 +0000 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e36.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o4CKmm1l002064 for ; Wed, 12 May 2010 14:48:48 -0600 Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o4CKprRM089318 for ; Wed, 12 May 2010 14:51:53 -0600 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o4CKpqFR020007 for ; Wed, 12 May 2010 14:51:52 -0600 Received: from [127.0.0.1] (IBM-93AE43E63C0.usca.ibm.com [9.72.133.96]) by d03av05.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o4CKpqi5019974 for ; Wed, 12 May 2010 14:51:52 -0600 Message-ID: <4BEB14EC.60801@sbcglobal.net> Date: Wed, 12 May 2010 13:51:56 -0700 From: Kathey Marsden User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: Just heads up, possible protocol error issue on 10.6 References: <4BEAF7D4.6040305@sbcglobal.net> In-Reply-To: <4BEAF7D4.6040305@sbcglobal.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 5/12/2010 11:47 AM, Kathey Marsden wrote: > I just started IPv6 testing and hit the error below. I am not sure > what it's all about, but will investingate more thoroughly and get a > Jira filed this afternoon. > > It actually appears to be a security manager issue as it doesn't reproduce with -noSecurityManager and the actual error in the derby.log is. ============= begin nested exception, level (1) =========== ERROR XSLAQ: cannot create log file at directory /home/kmarsden/ipv6test/mydb/log. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.store.raw.log.LogToFile.getLogDirectory(Unknown Source) at org.apache.derby.impl.store.raw.log.LogToFile.getLogFileName(Unknown Source) at org.apache.derby.impl.store.raw.log.LogToFile.getLogFileAtPosition(Unknown Source) at org.apache.derby.impl.store.raw.log.Scan.(Unknown Source) at org.apache.derby.impl.store.raw.log.LogToFile.openBackwardsScan(Unknown Source) at org.apache.derby.impl.store.raw.log.FileLogger.undo(Unknown Source) at org.apache.derby.impl.store.raw.xact.Xact.popSavePoints(Unknown Source) at org.apache.derby.impl.store.raw.xact.Xact.rollbackToSavePoint(Unknown Source) at org.apache.derby.impl.store.access.RAMTransaction.rollbackToSavePoint(Unknown Source) at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.internalRollbackToSavepoint(Unknown Source) at org.apache.derby.impl.sql.conn.GenericStatementContext.cleanupOnError(Unknown Source) at org.apache.derby.iapi.services.context.ContextManager.cleanupOnError(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.cleanupOnError(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLIMM(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source) I am guessing it is there is an unreported security exception in LogFile where we call protected boolean privExists(StorageFile file) { return runBooleanAction(0, file); } private synchronized boolean runBooleanAction(int action, StorageFile file) { this.action = action; this.activeFile = file; try { return ((Boolean) java.security.AccessController.doPrivileged(this)).booleanValue(); } catch (java.security.PrivilegedActionException pae) { return false; } } I put a 10.7 build over there which prints a stack trace when a permission error occurs to find out what the exception is exactly happening of course it did not reproduce. I am going to narrow the 10.6 reproduction a bit and then file a bug. Then I will check out the 10.6 branch and work with that. Sorry for all the verbosity, but since I think it might be a show stopper I thought it good to send updates. Kathey > 66 java org.apache.derby.drda.NetworkServerControl start -h > 2002:92a:8f7a:13 > :9:42:73:216& > 67 java DataSourceTest > > > Exception in thread "main" > java.sql.SQLNonTransientConnectionException: Network > protocol exception: actual code point, 4,692, does not match expected > code point > , 9,224. The connection has been terminated. > at > org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unkn > own Source) > at > org.apache.derby.client.am.SqlException.getSQLException(Unknown Sourc > e) > at org.apache.derby.client.am.Statement.executeUpdate(Unknown > Source) > at DataSourceTest.GrantRevokeTest(DataSourceTest.java:46) > at DataSourceTest.main(DataSourceTest.java:25) > Caused by: org.apache.derby.client.am.DisconnectException: Network > protocol exce > ption: actual code point, 4,692, does not match expected code point, > 9,224. The > connection has been terminated. > at > org.apache.derby.client.net.Reply.parseLengthAndMatchCodePoint(Unknow > n Source) > at > org.apache.derby.client.net.NetConnectionReply.parseSQLCARD(Unknown S > ource) > at > org.apache.derby.client.net.NetConnectionReply.parseRDBCMMreply(Unkno > wn Source) > at > org.apache.derby.client.net.NetConnectionReply.readLocalCommit(Unknow > n Source) > at > org.apache.derby.client.net.ConnectionReply.readLocalCommit(Unknown S > ource) > at > org.apache.derby.client.net.NetConnection.readLocalCommit_(Unknown So > urce) > at org.apache.derby.client.am.Connection.readCommit(Unknown > Source) > at > org.apache.derby.client.am.Connection.readAutoCommit(Unknown Source) > at org.apache.derby.client.am.Statement.flowExecute(Unknown > Source) > at org.apache.derby.client.am.Statement.executeUpdateX(Unknown > Source) > ... 3 more > > > import java.io.BufferedReader; > import java.io.File; > import java.io.FileInputStream; > import java.io.FileNotFoundException; > import java.io.FileReader; > import java.io.InputStream; > > import org.apache.derby.jdbc.EmbeddedDataSource; > import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource; > import org.apache.derby.jdbc.EmbeddedXADataSource; > import java.sql.Connection; > import java.sql.ResultSet; > import java.sql.PreparedStatement; > import java.sql.Statement; > import java.sql.Blob; > import java.sql.Clob; > import java.sql.SQLException; > import javax.sql.DataSource; > > public class DataSourceTest{ > public static void main(String[] args) throws Exception { > javax.sql.DataSource ds = getDS("mydb;create=true", null, null); > Connection conn = ds.getConnection("user2", "pass2"); > //DropTables(conn); > GrantRevokeTest(conn); > TestPStmt(conn); > TestClob(conn); > TestBlob(conn); > TestClobBlob(conn); > TestFunction(conn); > > } > public static void DropTables(Connection conn) throws Exception{ > Statement stmt = conn.createStatement(); > stmt.executeUpdate("drop table tab2"); > stmt.executeUpdate("drop table tabclob"); > stmt.executeUpdate("drop table tabblob"); > stmt.executeUpdate("drop table tabclobblob"); > stmt.executeUpdate("drop function f_abs"); > stmt.executeUpdate("drop table tabfunction"); > stmt.close(); > } > > public static void GrantRevokeTest(Connection conn) throws Exception{ > Statement stmt = conn.createStatement(); > stmt.executeUpdate("create table tab2(c1 int, c2 char(3))"); > stmt.executeUpdate("grant select on tab2 to public"); > ResultSet rs = stmt.executeQuery("select GRANTEE, GRANTOR, > SELECTPRIV, DELETEPRIV, INSERTPRIV, UPDATEPRIV, REFERENCESPRIV, > TRIGGERPRIV from sys.systableperms"); > while(rs.next()) > { > System.out.println("Gtrantee in the systableperms : " + > rs.getString(1)); > } > stmt.executeUpdate("grant select on tab2 to public"); > stmt.close(); > rs.close(); > System.out.println("GrantRevokeTest Passed"); > } > > public static void TestPStmt(Connection conn) throws Exception{ > PreparedStatement ps = conn.prepareStatement("insert into tab2 > values(?,?)"); > Statement stmt = conn.createStatement(); > for(int i=0;i<10;i++){ > ps.setInt(1,i); > ps.setString(2,"aa" +i); > ps.executeUpdate(); > } > ResultSet rs = stmt.executeQuery("select * from tab2"); > while(rs.next()) > System.out.println("Col1: "+rs.getInt(1)); > stmt.close(); > ps.close(); > rs.close(); > System.out.println("TestPStmt Passed"); > } > > public static void TestClob(Connection conn) throws Exception{ > String insertRow = "insert into tabclob values(?,?)"; > String ss= "create table tabclob(a int, b clob(3M))"; > Statement stmt = conn.createStatement(); > stmt.executeUpdate(ss); > PreparedStatement Insert = conn.prepareStatement(insertRow); > Insert.setInt(1,1); > try { > File inputfile = new File("l1.txt"); > FileReader fr = new FileReader(inputfile); > BufferedReader br = new BufferedReader(fr); > Insert.setCharacterStream(2, fr, (int) inputfile > .length()); > } catch (FileNotFoundException e) { > System.out.println("File not found Exception : " + > e.getMessage()); > throw e; > } > int rows = Insert.executeUpdate(); > System.out.println("Rows inserted: " + rows); > stmt.close(); > Insert.close(); > System.out.println("TestClob passed"); > > } > public static void TestBlob(Connection conn) throws Exception{ > String insertRow = "insert into tabblob values(?,?)"; > String ss= "create table tabblob(a int, b blob(3M))"; > Statement stmt = conn.createStatement(); > stmt.executeUpdate(ss); > PreparedStatement Insert = conn.prepareStatement(insertRow); > Insert.setInt(1,1); > try{ > File inputfile = new File("p1.jpg"); > InputStream fileIn = new FileInputStream(inputfile); > Insert.setBinaryStream(2, fileIn, (int) inputfile.length()); > }catch (FileNotFoundException e) { > System.out.println("File not found Exception : " + > e.getMessage()); > throw e; > } > int rows = Insert.executeUpdate(); > System.out.println("Rows inserted: " + rows); > stmt.close(); > Insert.close(); > System.out.println("TestBlob passed"); > > } > > public static void TestClobBlob(Connection conn) throws Exception{ > > String insertRow = "insert into tabclobblob values(?,?)"; > String ss= "create table tabclobblob(a clob(3M), b > blob(3M))"; > Statement stmt = conn.createStatement(); > stmt.executeUpdate(ss); > PreparedStatement Insert = conn.prepareStatement(insertRow); > ResultSet rs = stmt.executeQuery("select a, b from tabBlob"); > Blob blob = null; > Clob clob = null; > while (rs.next()) > blob = rs.getBlob(2); > if (blob != null) > Insert.setBlob(2,blob); > rs = stmt.executeQuery("select a, b from tabclob"); > while (rs.next()) > clob = rs.getClob(2); > if (clob != null) > Insert.setClob(1,clob); > int rows = Insert.executeUpdate(); > System.out.println("Rows inserted: " + rows); > rs.close(); > stmt.close(); > Insert.close(); > System.out.println("TestClobBlob Passed"); > > } > > public static void TestFunction(Connection conn)throws Exception{ > Statement stmt = conn.createStatement(); > int result = stmt.executeUpdate( > "CREATE FUNCTION F_ABS(P1 INT) RETURNS INT NO " > + "SQL RETURNS NULL ON NULL INPUT EXTERNAL NAME " > + "'java.lang.Math.abs' LANGUAGE JAVA PARAMETER STYLE JAVA"); > int abs = 0; > ResultSet rs = stmt.executeQuery(" values f_abs(-5)"); > while(rs.next()) > abs = rs.getInt(1); > System.out.println("abs value: " + abs); > String insertRow = "insert into tabfunction values(?,?)"; > String ss= "create table tabfunction(a int, b int)"; > //Statement stmt = conn.createStatement(); > stmt.executeUpdate(ss); > PreparedStatement Insert = conn.prepareStatement(insertRow); > Insert.setInt(1,1); > Insert.setInt(2,abs); > int rows = Insert.executeUpdate(); > System.out.println("Rows inserted: " + rows); > Insert.close(); > stmt.close(); > rs.close(); > System.out.println("TestFunction Passed"); > > } > > public static javax.sql.DataSource getDS(String database, String user, > String > password) throws SQLException > { > org.apache.derby.jdbc.ClientDataSource ds = > new org.apache.derby.jdbc.ClientDataSource(); > > // DatabaseName can include Derby URL Attributes > ds.setDatabaseName(database); > > if (user != null) > ds.setUser(user); > if (password != null) > ds.setPassword(password); > > // The host on which Network Server is running > //edit this to the name of the server(IPV6) you are using > ds.setServerName("wicopt1-v6.rtp.raleigh.ibm.com"); > > // port on which Network Server is listening > ds.setPortNumber(1527); > > return ds; > } > > } > > > > >