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
escay added a commit to escay/glassfish that referenced this issue Sep 23, 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.

Part 2 for issue eclipse-ee4j#24900 Start with a new PoolManagertImpl unit test to
understand enlisted versus busy states of Resource handles and the
wiring inside a transaction to keep track of all used resources.

Part 3 for issue eclipse-ee4j#24900 More documentation and more unit test coverage.

Part 4 for issue eclipse-ee4j#24900 Add more detailed logging to improve log file
analysis.
dmatej added a commit that referenced this issue Sep 30, 2024
Part 1,2,3,4 for issue #24900 Document and rename some ResourceHandle fields.
escay added a commit to escay/glassfish that referenced this issue Oct 8, 2024
associateConnection logic which is used by ConnectorXAResource in
connector-runtime
escay added a commit to escay/glassfish that referenced this issue Oct 11, 2024
…d associateConnection logic which is used by ConnectorXAResource in connector-runtime

Issue eclipse-ee4j#24900 write a few unit tests to start to understand associateConnection logic which is used by ConnectorXAResource in connector-runtime
escay added a commit to escay/glassfish that referenced this issue Oct 21, 2024
associateConnection logic which is used by ConnectorXAResource in
connector-runtime
dmatej added a commit that referenced this issue Oct 31, 2024
Issue #24900 add a few unit tests for ManagedConnectionImpl and ConnectionHolder to understand associateConnection logic
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