db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Post (JIRA)" <derby-...@db.apache.org>
Subject [jira] Created: (DERBY-145) RAFContainer readPage method is not thread safe
Date Sun, 13 Feb 2005 01:11:11 GMT
RAFContainer readPage method is not thread safe

         Key: DERBY-145
         URL: http://issues.apache.org/jira/browse/DERBY-145
     Project: Derby
        Type: Bug
  Components: Store  
 Environment: N/A
    Reporter: Rick Post
    Priority: Minor

readPage method comment says 'thread safe and has a synchronized block.

But 'pageOffset' computation occurs outside the sync block as does decryption.

This allows the (remote?) possibility of part of the operation(s) being performed using the
wrong pageNumber or pageData.

Fix - synchronize the method rather than the block

		Read a page into the supplied array.

		<BR> MT - thread safe
		@exception IOException exception reading page
		@exception StandardException Standard Cloudscape error policy
	protected void readPage(long pageNumber, byte[] pageData)
		 throws IOException, StandardException
		if (SanityManager.DEBUG) {

		long pageOffset = pageNumber * pageSize;

		synchronized (this) {


			fileData.readFully(pageData, 0, pageSize);

		if (dataFactory.databaseEncrypted() &&
			decryptPage(pageData, pageSize);

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message