如何判断graph是否支持事务?

How to find out whether graph supports transactions?

当我为 TinkerGraph 调用 graph.tx() 时,出现图形不支持事务的异常。但是我如何检查图表是否支持它们?

graph.features().graph().supportsTransactions()

您可以使用 GraphFeatures 来确定:

graph.features().graph().supportsTransactions()

如果支持交易,将 return true。您可以阅读更多关于 GraphFeatures here and more about transactions here.