A userdefined function MYFUNC(VALUE), bound to a DOMAIN CHECK(MYFUNC(VALUE))
does not work from second DB start onwards.
Reason: The DB reloads meta data by a fixed ordering where FUNCTIONS loaded 
after DOMAINS.
This results in a "FUNCTION not found" exception when recreating the DOMAIN.

I dont know a way to solve this w/o modifying the code:

I changed MetaRecord.compareTo() to load functions with lower IDs than 
DOMAINs first. 
This reflects my original creation order. 

    @Override
    public int compareTo( MetaRecord other)
    {
        int c1 = createOrder.get(gertObjectType());
        int c2 = createOrder.get(other.getObjectType());
        if (c1 != c2)
        {
            int o1 = getObjectType();
            int o2 = other.getObjectType();
            if (o1 == DBObject.FUNCTION_ALIAS
              && o2 == DBObject.USER_DATATYPE)
            {
                if (getId() < other.getId()) { return -1; }
            }
            if (o2 == DBObject.FUNCTION_ALIAS
              && o1 == DBObject.USER_DATATYPE)
            {
                if (other.getId() < getId()) { return 1; }
            }
            return c1 - c2;
        }
        return getId() - other.getId();
    }

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/h2-database/-/CFYPbTRcgN0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to