wouterdoeland
01/19/2018, 4:49 PMJdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL)
while close on exit = false is already set?
@Before
fun setupDatabase() {
Database.connect("jdbc:h2:mem:test;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1", "org.h2.Driver")
// create tables
}
@After
fun tearDownDatabase() {
transaction {
exec("SHUTDOWN;")
}
}
apomelov
01/22/2018, 9:50 AMoshai
01/23/2018, 1:45 PMwouterdoeland
01/23/2018, 5:16 PMorg.h2.jdbc.JdbcSQLException: The object is already closed
is thrown. At:
val map = transaction { loggedRequest.parameters } // throws exception
val map = transaction { loggedRequest.method } // doesn't throw exception
For:
object ApiLogs : IntIdTable() {
...
val parameters = text("parameters")
val method = varchar("method", 191)
...
}
class ApiLog(id: EntityID<Int>) : IntEntity(id) {
companion object : IntEntityClass<ApiLog>(ApiLogs)
...
var parameters by ApiLogs.parameters
var method by ApiLogs.method
...
}
dave08
01/25/2018, 8:51 PMdumptruckman
01/25/2018, 10:19 PMdave08
01/26/2018, 10:24 AMasync { }.await()
and make their own thread pools... I have a coroutine utils package in most of my projects for such things that I keep having to copy... it would be great if it could be integrated into the lib...wouterdoeland
01/26/2018, 1:39 PM[14:31:02 ERROR]: [Exposed] mysql 5.5 doesn't support expression '(CURRENT_TIMESTAMP)' as default value. Column will be created with NULL marker.
. I'm using MariaDB 10.1.26.damian
01/27/2018, 9:00 PMoptionalReferencedOn
, is it possible in a query to access the referenced object? (for example User
has a reference to City
, and City
has a column Inhabitants
and i want to get all users living in a city
with at least 5k inhabitants) (typing it, it seems like it would be a better approach from "the other side" (looking for cities with inhabitants and getting all users
that have a reference to those cities, but not sure how i'd do that either atm)oshai
01/28/2018, 2:45 PMlong
, what are my options? decimal
?dave08
01/28/2018, 3:33 PMnekoinemo
02/20/2018, 3:18 PMwouterdoeland
02/23/2018, 8:20 AMCaused by: java.sql.SQLException: Multiple primary key defined
Query is: ALTER TABLE Clans MODIFY COLUMN id INT AUTO_INCREMENT PRIMARY KEY
Does anyone know why this is happening? This happens everytime I run SchemaUtils.createMissingTablesAndColumns(Clans)
with Clans or with any other table.oshai
02/26/2018, 12:35 PMtransaction(statement)
tapac
02/26/2018, 1:02 PMinsertAndGetId
When you write insert[id]
you try to get value related to "expression" from resultSet. It can be null if, for example, it wasn't inserted, that's why column type (not-nullable) doesn't make sense.ziad
03/02/2018, 5:19 PMreturn transaction {
//Check if a user with this device id exists
val userIdEntity = Users.select {
Users.deviceId eq deviceId
}.map { it[Users.id] }.firstOrNull()
//Assign the user id
val userId =
if(userIdEntity != null) {
userIdEntity.value
} else
{
Users.insertAndGetId {
//...
}.value
}
}
avolkmann
03/03/2018, 12:16 PMniteesh
03/05/2018, 11:44 AMmattiascrofani
03/09/2018, 11:18 AM(AccessToken innerJoin Staff).slice(Staff.id, Staff.userName).select {AccessToken.idStaff eq Staff.id}
betterclever
03/11/2018, 11:56 AMoshai
03/11/2018, 4:15 PM... don't have client default values. DB defaults don't support in batch inserts
why is that not supported?betterclever
03/11/2018, 4:36 PMzjor
03/12/2018, 9:28 PMDatabase.connect("<url>", driver = "org.postgresql.Driver", user = "..", password = "...")
transaction {
and which is the common approach to initialise Database, so I don't create it in each service method?
Thanks in advancetmseiler
03/13/2018, 10:15 PMavolkmann
03/14/2018, 12:50 PMResultRow.get(Max(Table.id, IntegerColumnType()))
Nate Mara
03/15/2018, 10:54 PMfun findX(xGt: BigDecimal?, xLt: BigDecimal?): List<DaoClass> {
return transaction {
DaoClass.find {
var condition = TableClass.any()
if (xGt != null) {
condition = condition.and(TableClass.x.greater(xGt))
}
if (xLt != null) {
condition = condition.and(TableClass.x.less(xGt))
}
condition
}.toList()
}
}
Is this possible?aeruhxi
03/27/2018, 4:44 PMmkporwit
03/29/2018, 10:53 PMmkporwit
04/02/2018, 7:12 PMval org by Org referencedOn OrgMemberships.orgId
has a type mismatch, where it expects a Column<EntityId<Int>>
but gets a Column<EntityId<String>>
. How do I tell OrgMembership to use that string?alex.rios
04/04/2018, 7:08 PMalex.rios
04/04/2018, 7:08 PMtapac
04/05/2018, 12:27 PM