2013-08-19

←Older revision

Revision as of 04:54, 19 August 2013

(6 intermediate revisions not shown.)

Line 69:

Line 69:

The server log appears similar to the following:<br>

The server log appears similar to the following:<br>

-

<pre>11:17:54 INFO - [http-8080-5 ] ActivityInstanceBean - State change for Activity instance 'CallEmployeeService', oid: 1584 (process instance = 112): Application-->Interrupted.

+

<pre>11:17:54 INFO - [http-8080-5 ] ActivityInstanceBean - State change for Activity instance 'CallEmployeeService',

-

11:17:54 WARN - [http-8080-5 ] AuditTrailLogger - Activity thread interrupted at 'Activity: Call Employee Service', reason: javax.persistence.PersistenceException: Exception

+

oid: 1584 (process instance = 112): Application-->Interrupted.

-

[EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException

+

11:17:54 WARN - [http-8080-5 ] AuditTrailLogger - Activity thread interrupted at 'Activity: Call Employee

-

Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '5' for key 'PRIMARY'

+

Service', reason: javax.persistence.PersistenceException: Exception

 

+

[EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635):

 

+

org.eclipse.persistence.exceptions.DatabaseException

 

+

Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:

 

+

Duplicate entry '5' for key 'PRIMARY'

</pre>

</pre>

-

This Emp Id is not persisted to the Employee database.

+

This Emp Id is not persisted to the Employee database.

=== Scenario - Application Exception on first service ===

=== Scenario - Application Exception on first service ===

Line 137:

Line 141:

The server log appears similar to the following:<br>

The server log appears similar to the following:<br>

-

<pre>11:17:54 INFO - [http-8080-5 ] ActivityInstanceBean - State change for Activity instance 'CallEmployeeService',

oid: 1584 (process instance = 112): Application-->Interrupted.

+

<pre>11:17:54 INFO - [http-8080-5 ] ActivityInstanceBean - State change for Activity instance 'CallEmployeeService',

-

11:17:54 WARN - [http-8080-5 ] AuditTrailLogger - Activity thread interrupted at 'Activity: Call Employee Service', reason: javax.persistence.PersistenceException: Exception

+

oid: 1584 (process instance = 112): Application-->Interrupted.

-

[EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException

+

11:17:54 WARN - [http-8080-5 ] AuditTrailLogger - Activity thread interrupted at 'Activity: Call Employee

-

Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '5' for key 'PRIMARY'

+

Service', reason: javax.persistence.PersistenceException: Exception

 

+

[EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635):

 

+

org.eclipse.persistence.exceptions.DatabaseException

 

+

Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:

 

+

Duplicate entry '5' for key 'PRIMARY'

</pre>

</pre>

-

This Emp Id is not persisted to the Employee database.

+

This Emp Id is not persisted to the Employee database.

=== Scenario - Application Exception on first service ===

=== Scenario - Application Exception on first service ===

Line 202:

Line 210:

In this scenario although the TX isn't global, a TX exception raised in the service results in the Stardust engine rolling back the process. A Stardust ServiceException is thrown on the UI and the first manual activity is again enabled as seen below:<br>

In this scenario although the TX isn't global, a TX exception raised in the service results in the Stardust engine rolling back the process. A Stardust ServiceException is thrown on the UI and the first manual activity is again enabled as seen below:<br>

-

[[Image:Stardust Knowledge Base Transaction Management TX Management LocalRes Always TX.png]]<br>

+

[[Image:Stardust Knowledge Base Transaction Management TX Management LocalRes Always TX.png
|1000px
]]<br>

The process history view in the portal confirms the rollback<br>

The process history view in the portal confirms the rollback<br>

Line 219:

Line 227:

This Emp Id is not persisted to the Employee database.

This Emp Id is not persisted to the Employee database.

-

The Log_Entry table in the Stardust Audit Trail persists the rollback information as shown below:

+

The Log_Entry table in the Stardust Audit Trail persists the rollback information as shown below:

-

[[Image:
Stardust_Knowledge_Base_Transaction_Management_TX_Management_LocalRes_Always_TX_Log_Entry
.png]]

+

[[Image:
Stardust Knowledge Base Transaction Management TX Management LocalRes Always TX Log Entry
.png
|1000px
]]

=== Scenario - Application Exception on first service ===

=== Scenario - Application Exception on first service ===

Line 227:

Line 235:

Despite the fact that this scenario requires only an application exception to be raised we expect the process to be rolled back in this case. Enter the Emp Id 1001. Per the service definition described earlier this ought to result in an application exception. A Stardust ServiceException similar to the one below is thrown on the UI (note the difference in the exception reason compared to the previous scenario):<br>

Despite the fact that this scenario requires only an application exception to be raised we expect the process to be rolled back in this case. Enter the Emp Id 1001. Per the service definition described earlier this ought to result in an application exception. A Stardust ServiceException similar to the one below is thrown on the UI (note the difference in the exception reason compared to the previous scenario):<br>

-

[[Image:Stardust Knowledge Base Transaction Management TX Management LocalRes Always App.png]] 

+

[[Image:Stardust Knowledge Base Transaction Management TX Management LocalRes Always App.png
|1000px
]] 

The process history view indicates that the process has been rolled back all the way to the first manual activity:

The process history view indicates that the process has been rolled back all the way to the first manual activity:

Line 241:

Line 249:

This Emp Id is not persisted to the Employee database.

This Emp Id is not persisted to the Employee database.

-

The Log_Entry in the Stardust Audit Trail persists the information related to the process rollback as shown below:

+

The Log_Entry in the Stardust Audit Trail persists the information related to the process rollback as shown below:

-

[[Image:
Stardust_Knowledge_Base_Transaction_Management_TX_Management_LocalRes_Always_App_Log_Entry
.png]]

+

[[Image:
Stardust Knowledge Base Transaction Management TX Management LocalRes Always App Log Entry
.png]]

=== Scenario - TX rollback exception on second service ===

=== Scenario - TX rollback exception on second service ===

Line 271:

Line 279:

The Log_Entry table in the Stardust Audit Trail persists the rollback information related to each retry. We therefore see 10 entries for the above scenario as seen below:

The Log_Entry table in the Stardust Audit Trail persists the rollback information related to each retry. We therefore see 10 entries for the above scenario as seen below:

-

[[Image:Stardust Knowledge Base Transaction Management TX Management LocalRes Always TX 2 Log Entry.png]]

+

[[Image:Stardust Knowledge Base Transaction Management TX Management LocalRes Always TX 2 Log Entry.png
|1000px
]]

=== Scenario - Application exception on second service ===

=== Scenario - Application exception on second service ===

-

In this scenario despite the fact that an application exception is raised in a resource local TX environment, the Stardust engine ought to rolls back the process all the way to the previous commit point it is aware of. The Employee information passed for the first service call ought to be persisted. Enter an Emp Id say 11 that does not currently exist in the Employee database. This will ensure that the first service call executes without any exception while a PK violation is thrown by the database for the second service call when it tries to insert an Emp Id >1000. This will result in an application exception in the second service invocation. No exception is shown on the UI since the last commit point is after the activity "Call Employee Service". The process history view therefore looks like the following and reveals that there has been a rollback:<br>

+

In this scenario despite the fact that an application exception is raised in a resource local TX environment, the Stardust engine ought to rolls back the process all the way to the previous commit point it is aware of. The Employee information passed for the first service call ought to be persisted. Enter an Emp Id say 11 that does not currently exist in the Employee database. This will ensure that the first service call executes without any exception while a PK violation is thrown by the database for the second service call when it tries to insert an Emp Id >1000. This will result in an application exception in the second service invocation. No exception is shown on the UI since the last commit point is after the activity "Call Employee Service". The process history view therefore looks like the following and reveals that there has been a rollback:<br>

-

[[Image:
Stardust_Knowledge_Base_Transaction_Management_TX_Management_LocalRes_Always_App_2_History
.png]]<br>

+

[[Image:
Stardust Knowledge Base Transaction Management TX Management LocalRes Always App 2 History
.png]]<br>

The server log shows the following exception and indicates that the default retry mechanism in Stardust has attempted to re-execute the service 10 times.<br>

The server log shows the following exception and indicates that the default retry mechanism in Stardust has attempted to re-execute the service 10 times.<br>

Line 292:

Line 300:

The Emp Id entered by the user is now seen in the Employee database.

The Emp Id entered by the user is now seen in the Employee database.

-

The Log_Entry table in the Audit Trail persists the informaiton related to the rollbacks:

+

The Log_Entry table in the Audit Trail persists the informaiton related to the rollbacks:

-

[[Image:
Stardust_Knowledge_Base_Transaction_Management_TX_Management_LocalRes_Always_App_2_Log_Entry
.png]]

+

[[Image:
Stardust Knowledge Base Transaction Management TX Management LocalRes Always App 2 Log Entry
.png
|1000px
]]

== Distributed (JTA) Transaction Management ==

== Distributed (JTA) Transaction Management ==

Show more