Dropping DataType Shared Record Field/DB Column

Discussions about modeling, execution and management of process/application data.
Forum rules
Make sure every topic contains information about your LSPS version and if relevant also your server OS, client OS, database name and version, and application server name and version.
Byron Glueck
 
Posts: 85
Joined: Thu Apr 26, 2012 8:17 pm

Dropping DataType Shared Record Field/DB Column

Thu Nov 01, 2012 10:33 pm

In one of the datatype definitions, a field was removed from a shared record type, as a housekeeping exercise.
The field was not being used by any in any of the models (including those running models). Dropping the corresponding column creates load errors for existing models.
What's the strategy for dropping this column, short of waiting for all running models to finish/terminate? FYI, we use our own database management mechanism (ie., we do not update the schema during model upload).

#|2012-11-01T16:11:13.422-0400|INFO|glassfish3.1.2|org.hibernate.event.def.DefaultLoadEventListener|_ThreadID
=22;_ThreadName=Thread-2;|Error performing load commandorg.hibernate.exception.SQLGrammarException: could not load an entity batch: [ENTITY_125#<35, 151, 214, 90, 21
0, 209, 208, 36, 181, 170, 180, 171, 169, 168, 167, 166, 202, 191, 186, 182, 178, 176, 175, 174, 84, 118, 142, 153, 86, 113, 112, 111, 110, 116, 114, 98, 87, 59, 38, 57>]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.loadEntityBatch(Loader.java:1987) at org.hibernate.loader.entity.BatchingEntityLoader.load(BatchingEntityLoader.java:92)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3062)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:4
34)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:415)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:121)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:906)
at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:864)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:141)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:174)
at com.whitestein.lsps.model.sharedrecord.SharedRecordEntityLazyInitializer.getSharedRecordEntity(Shar
edRecordEntityLazyInitializer.java:52) at com.whitestein.lsps.model.sharedrecord.SharedRecordEntityProxy.getEntityName(SharedRecordEntityProx
y.java:47) at com.whitestein.lsps.engine.sharedrecord.RuntimeToHibernateConverter.getRecordType(RuntimeToHibernat
eConverter.java:318) at com.whitestein.lsps.engine.sharedrecord.RuntimeToHibernateConverter.convertToRuntime(RuntimeToHiber
nateConverter.java:309)
at com.whitestein.lsps.engine.sharedrecord.SharedRecordEntityAdapter.convertToRuntime(SharedRecordEnti
tyAdapter.java:495)
at com.whitestein.lsps.engine.sharedrecord.SharedRecordEntityAdapter.getPropertyInternal(SharedRecordE
ntityAdapter.java:173)
at com.whitestein.lsps.engine.sharedrecord.SharedRecordEntityAdapter.getProperty(SharedRecordEntityAda
pter.java:166)
at com.whitestein.lsps.engine.sharedrecord.SharedRecordHolderImpl.getProperty(SharedRecordHolderImpl.j
ava:81)
at com.whitestein.lsps.lang.Interpreter$InterpreterVisitor.visit(Interpreter.java:290)
at com.whitestein.lsps.lang.ast.PropertyExpression.accept(PropertyExpression.java:101)
at com.whitestein.lsps.lang.Interpreter.interpret(Interpreter.java:115)
at com.whitestein.lsps.lang.Interpreter$InterpreterVisitor$1.interpret(Interpreter.java:211)
at com.whitestein.lsps.lang.FunctionArgumentInterpreter.interpret(FunctionArgumentInterpreter.java:94)

Maros Bajtos
 
Posts: 145
Joined: Mon Feb 27, 2012 2:52 pm

Re: Dropping DataType Shared Record Field/DB Column

Tue Nov 06, 2012 10:06 am

The fact that it is not used by any of the running instances is not relevant - as long as there is some model uploaded on the server with the definition of the given field, lsps will try to load that field from the database. To avoid these errors, you need to unload the old model, which contains the definition of that particular field. If you have some existing running model instances, you need to perform model update to the newer model prior unloading the old one.

Byron Glueck
 
Posts: 85
Joined: Thu Apr 26, 2012 8:17 pm

Re: Dropping DataType Shared Record Field/DB Column

Wed Nov 07, 2012 4:24 pm

Excellent. Thank you.

Return to Data modeling

Who is online

Users browsing this forum: No registered users and 1 guest