Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document and refactor some connectors-runtime module code #24900

Open
escay opened this issue Apr 9, 2024 · 0 comments
Open

Document and refactor some connectors-runtime module code #24900

escay opened this issue Apr 9, 2024 · 0 comments

Comments

@escay
Copy link
Contributor

escay commented Apr 9, 2024

Environment Details

  • GlassFish Version (and build number): 7.0.14
  • JDK version: jdk-17.0.8.1_1-openjdk-adoptium
  • OS: Windows 10
  • Database: Postgresql

Problem description

  • Document (javadoc) some connection pool interfaces in connectors-runtime module to better understand issue NPE in ConnectorXAResource.getResourceHandle causes connection pool problems #24805. With focus on the ResourceHandle fields to understand all fields:
    • com.sun.appserv.connectors.internal.api.ResourceHandle
    • com.sun.enterprise.resource.ResourceHandle
    • com.sun.enterprise.resource.ResourceState
  • Refactor some code: remove unused methods, parameters and fields from interfaces.
  • Write new unit test to test and understand com.sun.enterprise.resource.pool.PoolManagerImpl mainly regarding state isBusy and state enlisted behaviour of ResourceHandles.

Refactor items like:

ResourceHandle interface: remove destroyResource();
ConnectorConnectionPool: remove resourceSelectionStrategyClass
AssocWithThreadResourceHandle: remove ClientSecurityInfo from constructor
ResourceHandle: change resource and getResource() type from Object to ManagedConnection
 ## (risk if someone made their own implementation)
ResourceHandle: remove ClientSecurityInfo from constructor and field and getter/setter 
 ## (risk if someone made their own implementation)
ResourceHandle: remove subject field and getter/setter
ResourceHandle: remove partition field and getter/setter
ResourceHandle: remove setState setter, set state field immediately so it is never null
ResourceHandle: rename index to rwLockDataStructureResourceIndex
ResourceHandle: rename spec to resourceSpec
ResourceHandle: rename xaRes to xaResource
ResourceHandle: rename supportsLazyEnlistment_ to supportsLazyEnlistment
ResourceHandle: rename supportsLazyAssoc_ to supportsLazyAssociation

ResourceHandle / ResourceState: make ResourceState calls nullpointer safe.

ConnectionPool: remove resourceSelectionStrategyClass
ConnectionPool: rename validation to connectionValidationRequired
ConnectionPool: rename timer to resizerTaskTimer

DataStructureFactory: change parameters of class loading (risk if someone made their own implementation)

ListDataStructure: remove strategyClass from constructor
RWLockDataStructure: remove strategyClass from constructor	
escay added a commit to escay/glassfish that referenced this issue Apr 9, 2024
…Handle fields.

Document and rename some ConnectionPool fields.
Remove some unused methods and constructor parameters.
Functional / possible incompatibility changes in DataStructureFactory
and in ResourceHandle due to constructor changes.
escay added a commit to escay/glassfish that referenced this issue Apr 9, 2024
… unit test to

understand enlisted versus busy states of Resource handles and the
wiring inside a transaction to keep track of all used resources.
escay added a commit to escay/glassfish that referenced this issue Apr 12, 2024
escay added a commit to escay/glassfish that referenced this issue Sep 5, 2024
…Handle fields.

Document and rename some ConnectionPool fields.
Remove some unused methods and constructor parameters.
Functional / possible incompatibility changes in DataStructureFactory
and in ResourceHandle due to constructor changes.
escay added a commit to escay/glassfish that referenced this issue Sep 5, 2024
… unit test to

understand enlisted versus busy states of Resource handles and the
wiring inside a transaction to keep track of all used resources.
escay added a commit to escay/glassfish that referenced this issue Sep 5, 2024
escay added a commit to escay/glassfish that referenced this issue Sep 5, 2024
…ove log file

analysis. And fix a few merge errors after rebasing.
escay added a commit to escay/glassfish that referenced this issue Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant