Skip to content

Commit c71494d

Browse files
committed
javadocs
1 parent f10639e commit c71494d

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/main/java/org/datanucleus/store/connection/AbstractManagedConnection.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,22 @@ public void incrementUseCount()
6666

6767
/**
6868
* Commits the underlying connection.
69-
* This provides a default empty implementation. Connectors that use the fallback commit path (non-XA)
69+
* This provides a default empty implementation. Connectors that use the Non-XA commit path
7070
* should override this method to provide datastore-specific commit logic.
7171
*/
7272
public void commit()
7373
{
74-
// Do nothing by default. Override if your connector needs fallback commit logic.
74+
// Do nothing by default. Override if your connector needs Non-XA commit logic.
7575
}
7676

7777
/**
7878
* Rolls back the underlying connection.
79-
* This provides a default empty implementation. Connectors that use the fallback commit path (non-XA)
79+
* This provides a default empty implementation. Connectors that use the Non-XA commit path
8080
* should override this method to provide datastore-specific rollback logic.
8181
*/
8282
public void rollback()
8383
{
84-
// Do nothing by default. Override if your connector needs fallback rollback logic.
84+
// Do nothing by default. Override if your connector needs Non-XA rollback logic.
8585
}
8686

8787
public void close()
@@ -92,7 +92,7 @@ public void close()
9292

9393
/**
9494
* Release this connection back to the connection manager.
95-
* This method implements the "fallback" commit path for simple, non-XA datastores.
95+
* This method implements the "Non-XA" commit path for simple, non-XA datastores.
9696
* It decrements the usage count. When the count reaches zero, it checks the commitOnRelease
9797
* and closeOnRelease flags to perform the necessary actions.
9898
*/
@@ -102,8 +102,7 @@ public void release()
102102

103103
if (useCount == 0)
104104
{
105-
// This is the "fallback" commit path, used by connectors (like Neo4j) that
106-
// do not provide an XAResource and thus cannot be enlisted in the main transaction.
105+
// Non-XA commit path, used by connectors (like Neo4j) that do not provide an XAResource and thus cannot be enlisted in the main transaction.
107106
if (commitOnRelease)
108107
{
109108
commit();

src/main/java/org/datanucleus/store/connection/ConnectionManagerImpl.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
/**
4646
* Manager of connections for a datastore, allowing caching of ManagedConnections, enlistment in transaction.
4747
* Manages a "primary" and (optionally) a "secondary" ConnectionFactory.
48-
* When caching is enabled it maintains caches of the allocated ManagedConnection per ExecutionContext (an EC can have a single ManagedConnection per ConnectionFactory at any time).
48+
* When caching is enabled it maintains caches of the allocated ManagedConnection per ExecutionContext (an EC can have a single ManagedConnection per
49+
* ConnectionFactory at any time).
4950
* <p>
5051
* The "allocateConnection" method can create connections and enlist them (like most normal persistence operations need) or create a connection and return it
5152
* without enlisting it into a transaction, for example on a read-only operation, or when running non-transactional, or to get schema information.
@@ -360,8 +361,8 @@ private ManagedConnection allocateManagedConnection(final boolean primary, final
360361
// Determine which commit path to use.
361362
if (res != null && tx != null && !tx.isEnlisted(res))
362363
{
363-
// "Official" XA Path: This connection can be managed by the transaction manager.
364-
// Disable the fallback commit path to prevent double-commit deadlocks.
364+
// XA Path: This connection can be managed by the transaction manager.
365+
// Disable the Non-XA commit path to prevent double-commit deadlocks.
365366
mconnFromPool.setCommitOnRelease(false);
366367
mconnFromPool.setCloseOnRelease(false);
367368

@@ -373,16 +374,16 @@ private ManagedConnection allocateManagedConnection(final boolean primary, final
373374
}
374375
else if (res == null)
375376
{
376-
// "Fallback" Non-XA Path (e.g., Neo4j): No XAResource is available.
377-
// The connection MUST use the commit-on-release fallback mechanism.
377+
// Non-XA Path (e.g., Neo4j): No XAResource is available.
378+
// The connection MUST use the commit-on-release mechanism.
378379
mconnFromPool.setCommitOnRelease(true);
379380
mconnFromPool.setCloseOnRelease(false);
380381
}
381382
}
382383
else
383384
{
384385
// Not in a transaction: reset to default non-transactional behavior.
385-
// This enables the fallback commit path for the next single operation.
386+
// This enables the Non-XA commit path for the next single operation.
386387
mconnFromPool.setCommitOnRelease(true);
387388
mconnFromPool.setCloseOnRelease(false); // Keep in pool
388389
}
@@ -414,7 +415,7 @@ else if (res == null)
414415
// Determine which commit path to use.
415416
if (res != null && tx != null)
416417
{
417-
// "Official" XA Path: Enlist the resource and disable the fallback path.
418+
// XA Path: Enlist the resource and disable the Non-XA path.
418419
mconn.setCommitOnRelease(false);
419420
mconn.setCloseOnRelease(false);
420421

@@ -426,7 +427,7 @@ else if (res == null)
426427
}
427428
else
428429
{
429-
// "Fallback" Non-XA Path: Enable the commit-on-release mechanism.
430+
// Non-XA Path: Enable the commit-on-release mechanism.
430431
mconn.setCommitOnRelease(true);
431432
mconn.setCloseOnRelease(false);
432433
}

0 commit comments

Comments
 (0)