Thursday, May 24, 2018

Multiple phases commit

client invokes System A
  System A performs process
  if success
    System A commits
    System A invokes System B
    System B performs process
    if success
      System B commits
      System B invokes System N..
      System N.. performs process
      if success
        System N.. commits
        System N.. rollback
        System N.. return false
      System B rollback
      System B return false
    System A rollback
    System A returns fail

to simplified the above logic,
1.    process and commit own transaction.
2.    invoke external system/process
3.1 if success, return true
3.2 if failed, return false, manual rollback the transaction.


Tuesday, May 15, 2018

How to change font in Oracle SQL Developer

Tools > Preferences... > Code Editor > Fonts

edit the Font Name, Font Size
Click OK.


Sunday, March 4, 2018

java.lang.ClassCastException: $ProxyXX cannot be cast to xxx

When a system using EJB encountered a ClassCastException: $ProxyXX...
this could be due to same mappedName in the same system.

@Stateless(name = "MyBusinessObject", mappedName = "MyBusinessObject")

Therefore, when the system encountered the above exception,
the developer needs to check whether the class throwing the above exception mappedName also used in other class.


Thursday, October 26, 2017

How to transform Play project as Eclipse project

To transform a new Play project into Eclipse workspace.
the following steps can be followed.

1. navigate into the play project root directory. eg. C:\my-play-project

2. add the following plugin into the end of project/plugins.sbt

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.2")

3. add the following configuration into the end of build.sbt

EclipseKeys.preTasks := Seq(compile in Compile, compile in Test)
EclipseKeys.projectFlavor := EclipseProjectFlavor.Java  
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources) 


Related Posts Plugin for WordPress, Blogger...