- changed status to resolved
Problems using SessionContext in Functions Supplying Default Values
Issue #703
resolved
I have a function that allocates primary keys to a table, using a custom method. I have set my table's primary key column to take its default from this function. Inside the function, it accesses a table, which servers a pseudo-sequence. I found that changes made to the data in the table row do not get propagated back to the database.
Presumably this happens because the default value is only fetched within the flush(), so the updated pseudo-sequence table doesn't get included in the flush. The problem is only really likely to occur when using SessionContext.
I've attached a test case.
Comments (2)
-
repo owner -
repo owner - removed milestone
Removing milestone: 0.4.0 (automated comment)
- Log in to comment
as mentioned on the list, the recommended pattern here is this:
8f17efd7a3c337045299927f1a30cbbd013dd6b1 adds some extra logic to ensure that context.connection is freely usable within default generator functions.