db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bakk...@apache.org
Subject svn commit: r329187 [50/66] - in /db/derby/code/trunk: ./ frameworks/NetworkServer/ frameworks/NetworkServer/bin/ frameworks/embedded/bin/ java/build/ java/build/org/apache/derbyBuild/ java/build/org/apache/derbyBuild/eclipse/ java/build/org/apache/der...
Date Fri, 28 Oct 2005 12:52:21 GMT
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup.java?rev=329187&r1=329186&r2=329187&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup.java
Fri Oct 28 04:51:50 2005
@@ -1,263 +1,263 @@
-/*
-
-   Derby - Class org.apache.derbyTesting.functionTests.store.LogChecksumSetup
-
-   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
- */
-
-package org.apache.derbyTesting.functionTests.tests.store;
-import java.sql.*;
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.zip.CRC32;
-import org.apache.derbyTesting.functionTests.util.corruptio.CorruptibleIo;
-import org.apache.derby.tools.ij;
-
-/*
- * Purpose of this class is to simulate out of order incomplete 
- * log write corruption (see derby-96 for details) using the proxy storage
- * factory (org.apache.derbyTesting.functionTests.util.corruptio.
- * CorruptDiskStorageFactory) instead of the default storage factory.
- * By defailt all io is delegated to the default database storage factory,
- * except when corruption is enabled through CorruptibleIo class.
- * Proxy storage factory is loaded using the following properties in 
- * the test properties file:
- * derby.subSubProtocol.csf=org.apache.derbyTesting.functionTests.
- *             util.corruptio.CorruptDiskStorageFactory
- *  database=jdbc:derby:csf:wombat
- *
- * @author <a href="mailto:suresh.thalamati@gmail.com">Suresh Thalamati</a>
- * @version 1.0
- * @see CorruptibleIo
- */
-
-public class LogChecksumSetup{
-
-	private CorruptibleIo cbio;
-
-	LogChecksumSetup()
-	{
-		cbio = CorruptibleIo.getInstance();
-	}
-	
-	/**
-	 * Insert some rows into the table and corrupt the log for the last row,
-	 * so when we recover , there should be one row less even though we committed.
-	 */
-	void insertAndCorrupt(Connection conn, int rowCount) throws SQLException {
-
-		PreparedStatement ps = conn.prepareStatement("INSERT INTO " + 
-													 "T1" + 
-													 " VALUES(?,?,?)");
-
-		java.util.Random r = new java.util.Random();
-		CRC32 checksum = new CRC32(); // holder for the checksum
-		boolean corrupt = false;
-		for (int i = 0; i < rowCount; i++) {
-			
-			//setup last row for log corruption
-			if (i == (rowCount -1 ))
-			{
-				// Note: offset/len for corruption  here refers to 
-				// the actual log write request
-				// that is being done for this insert. 
-				setupLogCorruption(50, 10);
-				corrupt = true;
-			}
-			ps.setInt(1, i); // ID
-			byte[] dataBytes  = generateBinaryData(r, 90000 , 1000 * i);
-			ps.setBytes(2, dataBytes); 
-			//calculate checksum for blob data 
-			checksum.update(dataBytes, 0, dataBytes.length);
-			checksum.reset();
-			checksum.update(dataBytes, 0, dataBytes.length);
-			ps.setLong(3, checksum.getValue());
-			ps.executeUpdate();
-			conn.commit();
-		}
-	}
-
-		
-	/**
-	 * update some rows in the table and corrupt the log for the last row,
-	 * so when we recover , All checsum should be correct because corrupted 
-	 * log transaction should been rolled back.
-	 */
-
-	void updateAndCorrupt(Connection conn, int rowCount) throws SQLException{
-
-		PreparedStatement ps = conn.prepareStatement("update " + "T1" + 
-													 " SET " +
-													 "DATA=?, DATACHECKSUM=? where ID=?");
-		
-		java.util.Random r = new java.util.Random();
-		CRC32 checksum = new CRC32(); // holder for the checksum
-		int updateCount = 0;
-		boolean corrupt = false;
-		for (int i = 0; i < rowCount; i++) {
-			
-			//setup last row for log corruption
-			if (i == (rowCount -1 ))
-			{
-				// Note: offset/len for corruption  here refers to 
-				// the actual log write request
-				// that is being done for this insert. 
-				setupLogCorruption(50, 10);
-				corrupt = true;
-			}
-			byte[] dataBytes  = generateBinaryData(r, 1234 , 5000 * i);
-			ps.setBytes(1, dataBytes); 
-
-			// calculate checksum for blob data 
-			checksum.update(dataBytes, 0, dataBytes.length);
-			checksum.reset();
-			checksum.update(dataBytes, 0, dataBytes.length);
-
-			ps.setLong(2, checksum.getValue());
-			ps.setInt(3, i); // ID
-			updateCount +=  ps.executeUpdate();
-			conn.commit();
-		}
-	}
-
-
-	/*
-	 * read the data from the table and verify the blob data using the 
-	 * checksum and make sure that expected number rows exist in the table. 
-	 * 
-	 */
-	void verifyData(Connection conn, int expectedRowCount) throws SQLException {
-		
-		Statement s = conn.createStatement();
-		CRC32 checksum = new CRC32(); // holder for the checksum
-		
-		ResultSet rs = s.executeQuery("SELECT DATA , DATACHECKSUM, ID FROM "
-									  + "T1" );
-		int count = 0;
-		while(rs.next())
-		{
-			byte[] dataBytes = rs.getBytes(1);
-			long ckmRead = rs.getLong(2);
-			int id = rs.getInt(3);
-
-			checksum.reset();
-			checksum.update(dataBytes, 0, dataBytes.length);
-
-			if(checksum.getValue() != ckmRead )
-			{
-				logMessage("CHECKSUMs ARE NOT MATCHING");
-				logMessage("ID=" + id + " Checksum From DB:" + ckmRead);
-				logMessage("Recalcaulted sum :" + checksum.getValue());
-				logMessage("Length of Data:" +  dataBytes.length);
-			}
-			
-			count++;
-		}
-		conn.commit();
-
-		if(count != expectedRowCount)
-		{
-			logMessage("Expected Number Of Rows (" + 
-					   expectedRowCount + ")" +  "!="  + 
-					   "No Of rows in the Table(" + 
-					   count + ")");
-		}
-	}
-
-	/* 
-	 * create the tables that are used by this test.
-	 */
-	private  void createTable(Connection conn) throws SQLException {
-
-		Statement s = conn.createStatement();
-		s.executeUpdate("CREATE TABLE " + "T1" + "(ID INT," +
-						"DATA BLOB(300000),"+ 
-						"DATACHECKSUM BIGINT)");
-		conn.commit();
-		s.close();
-	}
-
-	/*
-	 * Log is corrupted using the corrupt storage factory. 
-	 * setup offset/length where we want the transaction 
-	 * log to be corrupted. Transaction tat the corruption 
-	 * is simulated  on should be rolled back because the log check
-	 * should identify that the writes were incomplete.  
-	 */
-	private void setupLogCorruption(int off , int len)
-	{
-		cbio.setLogCorruption(true);
-		cbio.setOffset(off); 
-		cbio.setLength(len); 
-	}
-
-
-	/*
-	 * utility routine to generate random byte array of data.
-	 */
-	private  byte[] generateBinaryData(java.util.Random r, 
-											 int factor,
-											 int size)	{
-		
-		ByteArrayOutputStream baos = new ByteArrayOutputStream(64);
-		try{
-			DataOutputStream daos = new DataOutputStream(baos);
-			for(int i = 0 ; i < size ; i++)
-			{
-				int p = r.nextInt() % factor;
-				if (p < 0)
-					p = p * -1;
-				daos.writeInt(p);
-			}
-			
-		}catch(IOException ie) 
-		{
-			logMessage(ie.getMessage()) ;
-		}
-		return baos.toByteArray();
-	}
-
-
-	private void runTest(Connection conn) throws SQLException
-	{
-		logMessage("Begin LogCheckum Setup Test");
-		createTable(conn);
-		insertAndCorrupt(conn, 11);
-		logMessage("End LogChecksum Setup Test");
-	}
-	
-    void logMessage(String   str)
-    {
-        System.out.println(str);
-    }
-
-	public static void main(String[] argv) throws Throwable {
-        LogChecksumSetup lctest = new LogChecksumSetup();
-   		ij.getPropertyArg(argv); 
-        Connection conn = ij.startJBMS();
-        conn.setAutoCommit(false);
-
-        try {
-            lctest.runTest(conn);
-        }
-        catch (SQLException sqle) {
-			org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(
-                System.out, sqle);
-			sqle.printStackTrace(System.out);
-		}
-    }
-}
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.store.LogChecksumSetup
+
+   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.store;
+import java.sql.*;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.zip.CRC32;
+import org.apache.derbyTesting.functionTests.util.corruptio.CorruptibleIo;
+import org.apache.derby.tools.ij;
+
+/*
+ * Purpose of this class is to simulate out of order incomplete 
+ * log write corruption (see derby-96 for details) using the proxy storage
+ * factory (org.apache.derbyTesting.functionTests.util.corruptio.
+ * CorruptDiskStorageFactory) instead of the default storage factory.
+ * By defailt all io is delegated to the default database storage factory,
+ * except when corruption is enabled through CorruptibleIo class.
+ * Proxy storage factory is loaded using the following properties in 
+ * the test properties file:
+ * derby.subSubProtocol.csf=org.apache.derbyTesting.functionTests.
+ *             util.corruptio.CorruptDiskStorageFactory
+ *  database=jdbc:derby:csf:wombat
+ *
+ * @author <a href="mailto:suresh.thalamati@gmail.com">Suresh Thalamati</a>
+ * @version 1.0
+ * @see CorruptibleIo
+ */
+
+public class LogChecksumSetup{
+
+	private CorruptibleIo cbio;
+
+	LogChecksumSetup()
+	{
+		cbio = CorruptibleIo.getInstance();
+	}
+	
+	/**
+	 * Insert some rows into the table and corrupt the log for the last row,
+	 * so when we recover , there should be one row less even though we committed.
+	 */
+	void insertAndCorrupt(Connection conn, int rowCount) throws SQLException {
+
+		PreparedStatement ps = conn.prepareStatement("INSERT INTO " + 
+													 "T1" + 
+													 " VALUES(?,?,?)");
+
+		java.util.Random r = new java.util.Random();
+		CRC32 checksum = new CRC32(); // holder for the checksum
+		boolean corrupt = false;
+		for (int i = 0; i < rowCount; i++) {
+			
+			//setup last row for log corruption
+			if (i == (rowCount -1 ))
+			{
+				// Note: offset/len for corruption  here refers to 
+				// the actual log write request
+				// that is being done for this insert. 
+				setupLogCorruption(50, 10);
+				corrupt = true;
+			}
+			ps.setInt(1, i); // ID
+			byte[] dataBytes  = generateBinaryData(r, 90000 , 1000 * i);
+			ps.setBytes(2, dataBytes); 
+			//calculate checksum for blob data 
+			checksum.update(dataBytes, 0, dataBytes.length);
+			checksum.reset();
+			checksum.update(dataBytes, 0, dataBytes.length);
+			ps.setLong(3, checksum.getValue());
+			ps.executeUpdate();
+			conn.commit();
+		}
+	}
+
+		
+	/**
+	 * update some rows in the table and corrupt the log for the last row,
+	 * so when we recover , All checsum should be correct because corrupted 
+	 * log transaction should been rolled back.
+	 */
+
+	void updateAndCorrupt(Connection conn, int rowCount) throws SQLException{
+
+		PreparedStatement ps = conn.prepareStatement("update " + "T1" + 
+													 " SET " +
+													 "DATA=?, DATACHECKSUM=? where ID=?");
+		
+		java.util.Random r = new java.util.Random();
+		CRC32 checksum = new CRC32(); // holder for the checksum
+		int updateCount = 0;
+		boolean corrupt = false;
+		for (int i = 0; i < rowCount; i++) {
+			
+			//setup last row for log corruption
+			if (i == (rowCount -1 ))
+			{
+				// Note: offset/len for corruption  here refers to 
+				// the actual log write request
+				// that is being done for this insert. 
+				setupLogCorruption(50, 10);
+				corrupt = true;
+			}
+			byte[] dataBytes  = generateBinaryData(r, 1234 , 5000 * i);
+			ps.setBytes(1, dataBytes); 
+
+			// calculate checksum for blob data 
+			checksum.update(dataBytes, 0, dataBytes.length);
+			checksum.reset();
+			checksum.update(dataBytes, 0, dataBytes.length);
+
+			ps.setLong(2, checksum.getValue());
+			ps.setInt(3, i); // ID
+			updateCount +=  ps.executeUpdate();
+			conn.commit();
+		}
+	}
+
+
+	/*
+	 * read the data from the table and verify the blob data using the 
+	 * checksum and make sure that expected number rows exist in the table. 
+	 * 
+	 */
+	void verifyData(Connection conn, int expectedRowCount) throws SQLException {
+		
+		Statement s = conn.createStatement();
+		CRC32 checksum = new CRC32(); // holder for the checksum
+		
+		ResultSet rs = s.executeQuery("SELECT DATA , DATACHECKSUM, ID FROM "
+									  + "T1" );
+		int count = 0;
+		while(rs.next())
+		{
+			byte[] dataBytes = rs.getBytes(1);
+			long ckmRead = rs.getLong(2);
+			int id = rs.getInt(3);
+
+			checksum.reset();
+			checksum.update(dataBytes, 0, dataBytes.length);
+
+			if(checksum.getValue() != ckmRead )
+			{
+				logMessage("CHECKSUMs ARE NOT MATCHING");
+				logMessage("ID=" + id + " Checksum From DB:" + ckmRead);
+				logMessage("Recalcaulted sum :" + checksum.getValue());
+				logMessage("Length of Data:" +  dataBytes.length);
+			}
+			
+			count++;
+		}
+		conn.commit();
+
+		if(count != expectedRowCount)
+		{
+			logMessage("Expected Number Of Rows (" + 
+					   expectedRowCount + ")" +  "!="  + 
+					   "No Of rows in the Table(" + 
+					   count + ")");
+		}
+	}
+
+	/* 
+	 * create the tables that are used by this test.
+	 */
+	private  void createTable(Connection conn) throws SQLException {
+
+		Statement s = conn.createStatement();
+		s.executeUpdate("CREATE TABLE " + "T1" + "(ID INT," +
+						"DATA BLOB(300000),"+ 
+						"DATACHECKSUM BIGINT)");
+		conn.commit();
+		s.close();
+	}
+
+	/*
+	 * Log is corrupted using the corrupt storage factory. 
+	 * setup offset/length where we want the transaction 
+	 * log to be corrupted. Transaction tat the corruption 
+	 * is simulated  on should be rolled back because the log check
+	 * should identify that the writes were incomplete.  
+	 */
+	private void setupLogCorruption(int off , int len)
+	{
+		cbio.setLogCorruption(true);
+		cbio.setOffset(off); 
+		cbio.setLength(len); 
+	}
+
+
+	/*
+	 * utility routine to generate random byte array of data.
+	 */
+	private  byte[] generateBinaryData(java.util.Random r, 
+											 int factor,
+											 int size)	{
+		
+		ByteArrayOutputStream baos = new ByteArrayOutputStream(64);
+		try{
+			DataOutputStream daos = new DataOutputStream(baos);
+			for(int i = 0 ; i < size ; i++)
+			{
+				int p = r.nextInt() % factor;
+				if (p < 0)
+					p = p * -1;
+				daos.writeInt(p);
+			}
+			
+		}catch(IOException ie) 
+		{
+			logMessage(ie.getMessage()) ;
+		}
+		return baos.toByteArray();
+	}
+
+
+	private void runTest(Connection conn) throws SQLException
+	{
+		logMessage("Begin LogCheckum Setup Test");
+		createTable(conn);
+		insertAndCorrupt(conn, 11);
+		logMessage("End LogChecksum Setup Test");
+	}
+	
+    void logMessage(String   str)
+    {
+        System.out.println(str);
+    }
+
+	public static void main(String[] argv) throws Throwable {
+        LogChecksumSetup lctest = new LogChecksumSetup();
+   		ij.getPropertyArg(argv); 
+        Connection conn = ij.startJBMS();
+        conn.setAutoCommit(false);
+
+        try {
+            lctest.runTest(conn);
+        }
+        catch (SQLException sqle) {
+			org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(
+                System.out, sqle);
+			sqle.printStackTrace(System.out);
+		}
+    }
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup_app.properties?rev=329187&r1=329186&r2=329187&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup_app.properties
Fri Oct 28 04:51:50 2005
@@ -1,6 +1,6 @@
-ij.protocol=jdbc:derby:csf
-derby.subSubProtocol.csf=org.apache.derbyTesting.functionTests.util.corruptio.CorruptDiskStorageFactory
-database=jdbc:derby:csf:wombat;create=true
-
-#Exclude for J2ME/Foundation - test requires java.sql.Driver
+ij.protocol=jdbc:derby:csf
+derby.subSubProtocol.csf=org.apache.derbyTesting.functionTests.util.corruptio.CorruptDiskStorageFactory
+database=jdbc:derby:csf:wombat;create=true
+
+#Exclude for J2ME/Foundation - test requires java.sql.Driver
 runwithfoundation=false

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup_app.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup_derby.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup_derby.properties?rev=329187&r1=329186&r2=329187&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup_derby.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup_derby.properties
Fri Oct 28 04:51:50 2005
@@ -1,2 +1,2 @@
-#set checkpoint interval to max to test recovery with full replay of log
-derby.storage.checkpointInterval=134217727
+#set checkpoint interval to max to test recovery with full replay of log
+derby.storage.checkpointInterval=134217727

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LogChecksumSetup_derby.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber.java?rev=329187&r1=329186&r2=329187&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber.java
Fri Oct 28 04:51:50 2005
@@ -1,216 +1,216 @@
-/*
-
-   Derby - Class org.apache.derbyTesting.functionTests.store.MaxLogNumber
-
-   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
- */
-
-package org.apache.derbyTesting.functionTests.tests.store;
-import java.sql.Connection;
-import java.sql.Statement;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import org.apache.derby.tools.ij;
-
-/*
- * This class tests log writes to the transaction log files with large log file
- * id's and does a setup to test recovery with large log file id's in 
- * MaxLogNumberRecovery.java test. Large log file id's are simulated using 
- * a debug flag 'testMaxLogFileNumber' in the log factory, this is enabled
- * by setting derby.debug.true=testMaxLogFileNumber in the properties file.
- * In Non debug mode, this tests just acts as a plain log recovery test.
- *
- * @author <a href="mailto:suresh.thalamati@gmail.com">Suresh Thalamati</a>
- * @version 1.0
- */
-
-public class MaxLogNumber{
-
-	MaxLogNumber() {
-	}
-	
-
-	private void runTest(Connection conn) throws SQLException {
-		logMessage("Begin MaxLogNumber Test");
-		// perform a checkpoint otherwise recovery test will look at log1 
-		// instead of the log number that gets by the testMaxLogFileNumber 
-		// debug flags.
-		performCheckPoint(conn);
-		createTable(conn);
-		insert(conn, 100, COMMIT, 10);
-		insert(conn, 100, ROLLBACK, 10);
-		update(conn, 50, COMMIT, 10);
-		update(conn, 50, ROLLBACK, 10);
-		verifyData(conn, 100);
-		//do some inserts that will be rolled back by recovey
-		insert(conn, 2000, NOACTION, 2000);
-		logMessage("End MaxLogNumber Test");
-	}
-
-	void performCheckPoint(Connection conn) throws SQLException
-	{
-		Statement stmt = conn.createStatement();
-		//wait to make sure that checkpoint thread finished it's work
-		stmt.executeUpdate("CALL SYSCS_UTIL.SYSCS_CHECKPOINT_DATABASE()");
-		stmt.close();
-	}
-
-		
-	/**
-	 * Insert some rows into the table.
-	 */
-	void insert(Connection conn, int rowCount, 
-				int txStatus, int commitCount) throws SQLException {
-
-		PreparedStatement ps = conn.prepareStatement("INSERT INTO " + 
-													 "emp" + 
-													 " VALUES(?,?,?)");
-		for (int i = 0; i < rowCount; i++) {
-			
-			ps.setInt(1, i); // ID
-			ps.setString(2 , "skywalker" + i);
-			ps.setFloat(3, (float)(i * 2000)); 
-			ps.executeUpdate();
-			if ((i % commitCount) == 0)
-			{
-				endTransaction(conn, txStatus);
-			}
-		}
-
-		endTransaction(conn, txStatus);
-		ps.close();
-	}
-
-
-	static final int COMMIT = 1;
-    static final int ROLLBACK = 2;
-	static final int NOACTION = 3;
-
-	void endTransaction(Connection conn, int txStatus) throws SQLException
-	{
-		switch(txStatus){
-		case COMMIT: 
-			conn.commit();
-			break;
-		case ROLLBACK:
-			conn.rollback();
-			break;
-		case NOACTION:
-			//do nothing
-			break;
-		}
-	}
-		
-	/**
-	 * update some rows in the table.
-	 */
-
-	void update(Connection conn, int rowCount, 
-				int txStatus, int commitCount) throws SQLException
-	{
-
-		PreparedStatement ps = conn.prepareStatement("update " + "emp" + 
-													 " SET salary=? where id=?");
-		
-		for (int i = 0; i < rowCount; i++) {
-
-			ps.setFloat(1, (float)(i * 2000 * 0.08));
-			ps.setInt(2, i); // ID
-			ps.executeUpdate();
-			if ((i % commitCount) == 0)
-			{
-				endTransaction(conn, txStatus);
-			}
-		}
-		endTransaction(conn, txStatus);
-		ps.close();
-	}
-
-
-	/*
-	 * verify the rows in the table. 
-	 */
-	void verifyData(Connection conn, int expectedRowCount) throws SQLException {
-		
-		Statement s = conn.createStatement();
-		ResultSet rs = s.executeQuery("SELECT ID, name from emp order by id" );
-		int count = 0;
-		int id = 0;
-		while(rs.next())
-		{
-			int tid = rs.getInt(1);
-			String name = rs.getString(2);
-			if(name.equals("skywalker" + id) && tid!= id)
-			{
-				
-				logMessage("DATA IN THE TABLE IS NOT AS EXPECTED");
-				logMessage("Got :ID=" +  tid + " Name=:" + name);
-				logMessage("Expected: ID=" + id + "Name=" + "skywalker" + id );
-			}
-
-			id++;
-			count++;
-		}
-
-		if(count != expectedRowCount)
-		{
-			logMessage("Expected Number Of Rows (" + 
-					   expectedRowCount + ")" +  "!="  + 
-					   "No Of rows in the Table(" + 
-					   count + ")");
-		}
-		s.close();
-	}
-
-	/* 
-	 * create the tables that are used by this test.
-	 */
-	void createTable(Connection conn) throws SQLException {
-
-		Statement s = conn.createStatement();
-		s.executeUpdate("CREATE TABLE " + "emp" + 
-						"(id INT," +
-						"name CHAR(200),"+ 
-						"salary float)");
-		s.executeUpdate("create index emp_idx on emp(id) ");
-		conn.commit();
-		s.close();
-	}
-
-	void logMessage(String   str)
-    {
-        System.out.println(str);
-    }
-	
-	
-	public static void main(String[] argv) throws Throwable {
-		
-        MaxLogNumber test = new MaxLogNumber();
-   		ij.getPropertyArg(argv); 
-        Connection conn = ij.startJBMS();
-        conn.setAutoCommit(false);
-
-        try {
-            test.runTest(conn);
-        }
-        catch (SQLException sqle) {
-			org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(
-                System.out, sqle);
-			sqle.printStackTrace(System.out);
-		}
-    }
-}
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.store.MaxLogNumber
+
+   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.store;
+import java.sql.Connection;
+import java.sql.Statement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import org.apache.derby.tools.ij;
+
+/*
+ * This class tests log writes to the transaction log files with large log file
+ * id's and does a setup to test recovery with large log file id's in 
+ * MaxLogNumberRecovery.java test. Large log file id's are simulated using 
+ * a debug flag 'testMaxLogFileNumber' in the log factory, this is enabled
+ * by setting derby.debug.true=testMaxLogFileNumber in the properties file.
+ * In Non debug mode, this tests just acts as a plain log recovery test.
+ *
+ * @author <a href="mailto:suresh.thalamati@gmail.com">Suresh Thalamati</a>
+ * @version 1.0
+ */
+
+public class MaxLogNumber{
+
+	MaxLogNumber() {
+	}
+	
+
+	private void runTest(Connection conn) throws SQLException {
+		logMessage("Begin MaxLogNumber Test");
+		// perform a checkpoint otherwise recovery test will look at log1 
+		// instead of the log number that gets by the testMaxLogFileNumber 
+		// debug flags.
+		performCheckPoint(conn);
+		createTable(conn);
+		insert(conn, 100, COMMIT, 10);
+		insert(conn, 100, ROLLBACK, 10);
+		update(conn, 50, COMMIT, 10);
+		update(conn, 50, ROLLBACK, 10);
+		verifyData(conn, 100);
+		//do some inserts that will be rolled back by recovey
+		insert(conn, 2000, NOACTION, 2000);
+		logMessage("End MaxLogNumber Test");
+	}
+
+	void performCheckPoint(Connection conn) throws SQLException
+	{
+		Statement stmt = conn.createStatement();
+		//wait to make sure that checkpoint thread finished it's work
+		stmt.executeUpdate("CALL SYSCS_UTIL.SYSCS_CHECKPOINT_DATABASE()");
+		stmt.close();
+	}
+
+		
+	/**
+	 * Insert some rows into the table.
+	 */
+	void insert(Connection conn, int rowCount, 
+				int txStatus, int commitCount) throws SQLException {
+
+		PreparedStatement ps = conn.prepareStatement("INSERT INTO " + 
+													 "emp" + 
+													 " VALUES(?,?,?)");
+		for (int i = 0; i < rowCount; i++) {
+			
+			ps.setInt(1, i); // ID
+			ps.setString(2 , "skywalker" + i);
+			ps.setFloat(3, (float)(i * 2000)); 
+			ps.executeUpdate();
+			if ((i % commitCount) == 0)
+			{
+				endTransaction(conn, txStatus);
+			}
+		}
+
+		endTransaction(conn, txStatus);
+		ps.close();
+	}
+
+
+	static final int COMMIT = 1;
+    static final int ROLLBACK = 2;
+	static final int NOACTION = 3;
+
+	void endTransaction(Connection conn, int txStatus) throws SQLException
+	{
+		switch(txStatus){
+		case COMMIT: 
+			conn.commit();
+			break;
+		case ROLLBACK:
+			conn.rollback();
+			break;
+		case NOACTION:
+			//do nothing
+			break;
+		}
+	}
+		
+	/**
+	 * update some rows in the table.
+	 */
+
+	void update(Connection conn, int rowCount, 
+				int txStatus, int commitCount) throws SQLException
+	{
+
+		PreparedStatement ps = conn.prepareStatement("update " + "emp" + 
+													 " SET salary=? where id=?");
+		
+		for (int i = 0; i < rowCount; i++) {
+
+			ps.setFloat(1, (float)(i * 2000 * 0.08));
+			ps.setInt(2, i); // ID
+			ps.executeUpdate();
+			if ((i % commitCount) == 0)
+			{
+				endTransaction(conn, txStatus);
+			}
+		}
+		endTransaction(conn, txStatus);
+		ps.close();
+	}
+
+
+	/*
+	 * verify the rows in the table. 
+	 */
+	void verifyData(Connection conn, int expectedRowCount) throws SQLException {
+		
+		Statement s = conn.createStatement();
+		ResultSet rs = s.executeQuery("SELECT ID, name from emp order by id" );
+		int count = 0;
+		int id = 0;
+		while(rs.next())
+		{
+			int tid = rs.getInt(1);
+			String name = rs.getString(2);
+			if(name.equals("skywalker" + id) && tid!= id)
+			{
+				
+				logMessage("DATA IN THE TABLE IS NOT AS EXPECTED");
+				logMessage("Got :ID=" +  tid + " Name=:" + name);
+				logMessage("Expected: ID=" + id + "Name=" + "skywalker" + id );
+			}
+
+			id++;
+			count++;
+		}
+
+		if(count != expectedRowCount)
+		{
+			logMessage("Expected Number Of Rows (" + 
+					   expectedRowCount + ")" +  "!="  + 
+					   "No Of rows in the Table(" + 
+					   count + ")");
+		}
+		s.close();
+	}
+
+	/* 
+	 * create the tables that are used by this test.
+	 */
+	void createTable(Connection conn) throws SQLException {
+
+		Statement s = conn.createStatement();
+		s.executeUpdate("CREATE TABLE " + "emp" + 
+						"(id INT," +
+						"name CHAR(200),"+ 
+						"salary float)");
+		s.executeUpdate("create index emp_idx on emp(id) ");
+		conn.commit();
+		s.close();
+	}
+
+	void logMessage(String   str)
+    {
+        System.out.println(str);
+    }
+	
+	
+	public static void main(String[] argv) throws Throwable {
+		
+        MaxLogNumber test = new MaxLogNumber();
+   		ij.getPropertyArg(argv); 
+        Connection conn = ij.startJBMS();
+        conn.setAutoCommit(false);
+
+        try {
+            test.runTest(conn);
+        }
+        catch (SQLException sqle) {
+			org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(
+                System.out, sqle);
+			sqle.printStackTrace(System.out);
+		}
+    }
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery.java?rev=329187&r1=329186&r2=329187&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery.java
Fri Oct 28 04:51:50 2005
@@ -1,104 +1,104 @@
-/*
-
-   Derby - Class org.apache.derbyTesting.functionTests.store.MaxLogNumber
-
-   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
- */
-
-package org.apache.derbyTesting.functionTests.tests.store;
-import java.sql.Connection;
-import java.sql.SQLException;
-import org.apache.derby.tools.ij;
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
-/*
- * This class  tests recovery logic with large log file id's and  the error
- * handling logic when Max possible log file limit is reached. MaxLogNumber.java
- * test does the setup, so it should be run before this test. 
- * In Non debug mode, this tests just acts as a plain log recovery test.
- *
- * @author <a href="mailto:suresh.thalamati@gmail.com">Suresh Thalamati</a>
- * @version 1.0
- * @see MaxLogNumber
- */
-
-public class MaxLogNumberRecovery extends MaxLogNumber {
-
-	MaxLogNumberRecovery() {
-		super();
-	}
-	
-	private void runTest(Connection conn) throws SQLException {
-		logMessage("Begin MaxLogNumberRecovery Test");
-		verifyData(conn, 100);
-		boolean hitMaxLogLimitError = false;
-		try{
-			insert(conn, 110, COMMIT, 11);
-			update(conn, 110, ROLLBACK, 5);
-			update(conn, 110, NOACTION, 5);
-			verifyData(conn, 210);
-			if (SanityManager.DEBUG)
-			{
-				// do lot of inserts in debug mode , 
-				// so that actuall reach the max log file number 
-				// limit
-				insert(conn, 11000, COMMIT, 5);
-			}
-		} catch(SQLException se) {
-			
-			SQLException ose = se;
-			while (se != null) {
-      			if ("XSLAK".equals(se.getSQLState())) {
-					hitMaxLogLimitError = true;
-					break;
-				}
-				se = se.getNextException();
-			}
-			if(!hitMaxLogLimitError)
-				throw ose;
-		}
-
-		if (SanityManager.DEBUG)
-		{
-			// In the debug build mode , this test should hit the max log limit while
-			// doing above DML. 
-			if(!hitMaxLogLimitError)
-				logMessage("Expected: ERROR XSLAK:" +
-						   "Database has exceeded largest log file" +
-						   "number 8,589,934,591.");
-        }
-
-		logMessage("End MaxLogNumberRecovery Test");
-	}
-
-	
-	public static void main(String[] argv) throws Throwable {
-		
-        MaxLogNumberRecovery test = new MaxLogNumberRecovery();
-   		ij.getPropertyArg(argv); 
-        Connection conn = ij.startJBMS();
-        conn.setAutoCommit(false);
-
-        try {
-            test.runTest(conn);
-        }
-        catch (SQLException sqle) {
-			org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(
-                System.out, sqle);
-			sqle.printStackTrace(System.out);
-		}
-    }
-}
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.store.MaxLogNumber
+
+   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.store;
+import java.sql.Connection;
+import java.sql.SQLException;
+import org.apache.derby.tools.ij;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+
+/*
+ * This class  tests recovery logic with large log file id's and  the error
+ * handling logic when Max possible log file limit is reached. MaxLogNumber.java
+ * test does the setup, so it should be run before this test. 
+ * In Non debug mode, this tests just acts as a plain log recovery test.
+ *
+ * @author <a href="mailto:suresh.thalamati@gmail.com">Suresh Thalamati</a>
+ * @version 1.0
+ * @see MaxLogNumber
+ */
+
+public class MaxLogNumberRecovery extends MaxLogNumber {
+
+	MaxLogNumberRecovery() {
+		super();
+	}
+	
+	private void runTest(Connection conn) throws SQLException {
+		logMessage("Begin MaxLogNumberRecovery Test");
+		verifyData(conn, 100);
+		boolean hitMaxLogLimitError = false;
+		try{
+			insert(conn, 110, COMMIT, 11);
+			update(conn, 110, ROLLBACK, 5);
+			update(conn, 110, NOACTION, 5);
+			verifyData(conn, 210);
+			if (SanityManager.DEBUG)
+			{
+				// do lot of inserts in debug mode , 
+				// so that actuall reach the max log file number 
+				// limit
+				insert(conn, 11000, COMMIT, 5);
+			}
+		} catch(SQLException se) {
+			
+			SQLException ose = se;
+			while (se != null) {
+      			if ("XSLAK".equals(se.getSQLState())) {
+					hitMaxLogLimitError = true;
+					break;
+				}
+				se = se.getNextException();
+			}
+			if(!hitMaxLogLimitError)
+				throw ose;
+		}
+
+		if (SanityManager.DEBUG)
+		{
+			// In the debug build mode , this test should hit the max log limit while
+			// doing above DML. 
+			if(!hitMaxLogLimitError)
+				logMessage("Expected: ERROR XSLAK:" +
+						   "Database has exceeded largest log file" +
+						   "number 8,589,934,591.");
+        }
+
+		logMessage("End MaxLogNumberRecovery Test");
+	}
+
+	
+	public static void main(String[] argv) throws Throwable {
+		
+        MaxLogNumberRecovery test = new MaxLogNumberRecovery();
+   		ij.getPropertyArg(argv); 
+        Connection conn = ij.startJBMS();
+        conn.setAutoCommit(false);
+
+        try {
+            test.runTest(conn);
+        }
+        catch (SQLException sqle) {
+			org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(
+                System.out, sqle);
+			sqle.printStackTrace(System.out);
+		}
+    }
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery_app.properties?rev=329187&r1=329186&r2=329187&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery_app.properties
Fri Oct 28 04:51:50 2005
@@ -1,15 +1,15 @@
-#
-# *** DO NOT PUT PROPERTIES FOR THE DERBY SYSTEM IN THIS FILE.  THEY BELONG
-# *** IN the _derby.properties file.
-#
-# It will get handed to the test on the command line in a -p <filename>
-# argument.
-#
-# This causes ij (or the GUI on ij) to load the driver and make an
-# initial connection to the database.
-#
-#
-database=jdbc:derby:maxlogwombat
-
-#Exclude for J2ME/Foundation - test requires java.sql.Driver
-runwithfoundation=false
+#
+# *** DO NOT PUT PROPERTIES FOR THE DERBY SYSTEM IN THIS FILE.  THEY BELONG
+# *** IN the _derby.properties file.
+#
+# It will get handed to the test on the command line in a -p <filename>
+# argument.
+#
+# This causes ij (or the GUI on ij) to load the driver and make an
+# initial connection to the database.
+#
+#
+database=jdbc:derby:maxlogwombat
+
+#Exclude for J2ME/Foundation - test requires java.sql.Driver
+runwithfoundation=false

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery_app.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery_derby.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery_derby.properties?rev=329187&r1=329186&r2=329187&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery_derby.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery_derby.properties
Fri Oct 28 04:51:50 2005
@@ -1 +1 @@
-derby.debug.true=testMaxLogFileNumber
+derby.debug.true=testMaxLogFileNumber

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumberRecovery_derby.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber_app.properties?rev=329187&r1=329186&r2=329187&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber_app.properties
Fri Oct 28 04:51:50 2005
@@ -1,15 +1,15 @@
-#
-# *** DO NOT PUT PROPERTIES FOR THE DERBY SYSTEM IN THIS FILE.  THEY BELONG
-# *** IN the _derby.properties file.
-#
-# It will get handed to the test on the command line in a -p <filename>
-# argument.
-#
-# This causes ij (or the GUI on ij) to load the driver and make an
-# initial connection to the database.
-#
-#
-database=jdbc:derby:maxlogwombat;create=true
-
-#Exclude for J2ME/Foundation - test requires java.sql.Driver
-runwithfoundation=false
+#
+# *** DO NOT PUT PROPERTIES FOR THE DERBY SYSTEM IN THIS FILE.  THEY BELONG
+# *** IN the _derby.properties file.
+#
+# It will get handed to the test on the command line in a -p <filename>
+# argument.
+#
+# This causes ij (or the GUI on ij) to load the driver and make an
+# initial connection to the database.
+#
+#
+database=jdbc:derby:maxlogwombat;create=true
+
+#Exclude for J2ME/Foundation - test requires java.sql.Driver
+runwithfoundation=false

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber_app.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber_derby.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber_derby.properties?rev=329187&r1=329186&r2=329187&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber_derby.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber_derby.properties
Fri Oct 28 04:51:50 2005
@@ -1 +1 @@
-derby.debug.true=testMaxLogFileNumber
+derby.debug.true=testMaxLogFileNumber

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/MaxLogNumber_derby.properties
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message