Skip to content

Commit 1d42e27

Browse files
authored
DBOS.configure returns global instance (#300)
reverts a breaking change from #291 where DBOS.config was void return instead of returning the global instance. I think we should be keeping DBOS static and instnace APIs distinct, so returning the global instance from the static configure method seems wrong. However, this breaks a bunch of internal tests. So reverting until we understand the problem better is the right choice. Opened #299 to track fixing this
1 parent 92c574f commit 1d42e27

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • transact/src/main/java/dev/dbos/transact

transact/src/main/java/dev/dbos/transact/DBOS.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ public boolean deprecatePatch(@NonNull String patchName) {
785785
* Initializes the singleton instance of DBOS with config. Should be called once during app
786786
* startup, before launch. @DBOSConfig config dbos configuration
787787
*/
788-
public static void configure(DBOSConfig config) {
788+
public static Instance configure(DBOSConfig config) {
789789
if (globalInstance.get() != null) {
790790
throw new IllegalStateException("DBOS is already configured");
791791
}
@@ -795,6 +795,9 @@ public static void configure(DBOSConfig config) {
795795
if (!updated) {
796796
throw new IllegalStateException("DBOS is already configured");
797797
}
798+
799+
// TODO: https://github.com/dbos-inc/dbos-transact-java/issues/299
800+
return globalInstance.get();
798801
}
799802

800803
/**

0 commit comments

Comments
 (0)