Closed glikson closed 7 years ago
This is working as designed. The static field is "state" and if your action ends up reusing a container, state from previous invocations carries over to newer ones. You should not count on the container reuse but you can check for it (i.e. using a static). If you don't want this behavior then all static fields should be final and immutable.
OK, thanks. Sounds interesting. Is it documented somewhere?
not yet.
Changing title to reflect the actionable work: Document Java
Is there a basic example for deploying a java application somewhere yet ?
@psuter has a recent blog post as well: https://psuter.net/2017/01/20/openwhisk-java-gradle
It seems that static fields in Java actions are initialized only on first invocation of an action.
Not entirely sure whether this is a bug or a feature (that should be properly documented), and whether it is environment-dependent.