You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/org/datanucleus/store/connection/ConnectionManagerImpl.java
+9-8Lines changed: 9 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,8 @@
45
45
/**
46
46
* Manager of connections for a datastore, allowing caching of ManagedConnections, enlistment in transaction.
47
47
* 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).
49
50
* <p>
50
51
* The "allocateConnection" method can create connections and enlist them (like most normal persistence operations need) or create a connection and return it
51
52
* 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
360
361
// Determine which commit path to use.
361
362
if (res != null && tx != null && !tx.isEnlisted(res))
362
363
{
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.
365
366
mconnFromPool.setCommitOnRelease(false);
366
367
mconnFromPool.setCloseOnRelease(false);
367
368
@@ -373,16 +374,16 @@ private ManagedConnection allocateManagedConnection(final boolean primary, final
373
374
}
374
375
elseif (res == null)
375
376
{
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.
378
379
mconnFromPool.setCommitOnRelease(true);
379
380
mconnFromPool.setCloseOnRelease(false);
380
381
}
381
382
}
382
383
else
383
384
{
384
385
// 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.
386
387
mconnFromPool.setCommitOnRelease(true);
387
388
mconnFromPool.setCloseOnRelease(false); // Keep in pool
388
389
}
@@ -414,7 +415,7 @@ else if (res == null)
414
415
// Determine which commit path to use.
415
416
if (res != null && tx != null)
416
417
{
417
-
// "Official" XA Path: Enlist the resource and disable the fallback path.
418
+
// XA Path: Enlist the resource and disable the Non-XA path.
418
419
mconn.setCommitOnRelease(false);
419
420
mconn.setCloseOnRelease(false);
420
421
@@ -426,7 +427,7 @@ else if (res == null)
426
427
}
427
428
else
428
429
{
429
-
// "Fallback" Non-XA Path: Enable the commit-on-release mechanism.
430
+
// Non-XA Path: Enable the commit-on-release mechanism.
0 commit comments