Skip to content

Commit

Permalink
Merge branch 'adopt-orientdb' into adopt-orientdb-bump-xodus
Browse files Browse the repository at this point in the history
  • Loading branch information
leostryuk authored Nov 20, 2024
2 parents 21adf1b + efc1983 commit 6cb60e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.orientechnologies.orient.core.db.ODatabaseType
import com.orientechnologies.orient.core.db.OrientDB
import com.orientechnologies.orient.core.db.OrientDBConfig
import jetbrains.exodus.database.TransientEntityStore
import jetbrains.exodus.entitystore.orientdb.ODatabaseProvider
import jetbrains.exodus.entitystore.orientdb.ODatabaseProviderImpl
import jetbrains.exodus.env.EnvironmentConfig
import java.io.File
Expand All @@ -44,15 +45,17 @@ object StaticStoreContainer : StoreContainer {
val db = OrientDB("memory", builder.build())
val databaseType = ODatabaseType.MEMORY
db.createIfNotExists(entityStoreName, databaseType,"admin", "password", "admin")
val dbProvider = ODatabaseProviderImpl(
dbProvider = ODatabaseProviderImpl(
db,
entityStoreName,
"admin",
"password",
databaseType,
)
val store = createTransientEntityStore(dbProvider, entityStoreName)
val store = createTransientEntityStore(dbProvider!!, entityStoreName)
this.store = store
return store
}

var dbProvider: ODatabaseProvider? = null
}
2 changes: 2 additions & 0 deletions dnq/src/test/kotlin/kotlinx/dnq/DBTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import jetbrains.exodus.entitystore.TransientChangesMultiplexer
import jetbrains.exodus.entitystore.Where
import jetbrains.exodus.entitystore.Where.SYNC_AFTER_FLUSH
import jetbrains.exodus.entitystore.Where.SYNC_BEFORE_FLUSH_BEFORE_CONSTRAINTS
import jetbrains.exodus.entitystore.orientdb.OPersistentEntityStore
import jetbrains.exodus.util.IOUtil
import kotlinx.dnq.link.OnDeletePolicy.CLEAR
import kotlinx.dnq.listener.XdEntityListener
Expand Down Expand Up @@ -185,6 +186,7 @@ abstract class DBTest {
eventsMultiplexer.removeListener(it.first.entity, it.second.asEntityListener())
}
}
StaticStoreContainer.dbProvider?.close()
store.close()
}

Expand Down

0 comments on commit 6cb60e8

Please sign in to comment.