I have successfully upgraded from 2.1.2 to 2.2. This is of course not 
exactly the same upgrade as Chris.


Jari


Nicklas Nordborg wrote:
> Chris Wiita wrote:
>> I attempted a update to Base2.2 from a 2.1.1 installation.  Executing 
>> updatedb.sh worked until the "Updating database" step:
> 
> I really don't know why this is happening. The error message says 
> something about "Discriminator: 0" but we never use a 0, only the values 
> 1, 2, 3 and 4, which have the following meaning:
> 
>   1 = Biosource
>   2 = Sample
>   3 = Extract
>   4 = Labeled extract
> 
> Can you check the "BioMaterials" table and check if any row have a value 
> in the "discriminator" column that is not in the 1-4 range?
> 
> If there are such values they must be changed to one of the above. Then 
> we have to ask the question how they got there in the first place.
> 
> If there are only 1-4 the error message complaining about 
> "Discriminator: 0" is a bit confusing and is something that we need to 
> investigate further to see if we can reproduce the error.
> 
> Another option is to manually change the schema version to 29, but then 
> you will not get the changes between 28 and 29. Luckily, this change 
> doesn't involve any changes to the database. It only recalculates the 
> remaining quantity of all biomaterials since a bug may have caused them 
> to be incorrect. See ticket #466: http://base.thep.lu.se/ticket/466
> 
> I don't think it was a good idea to run the update script from an 
> earlier version. I really don't know if that might have messed things up 
> more or not. I'll add a ticket to make sure that the update script 
> checks the schema version and doesn't execute if it is too high. In any 
> case it is good that the main program does the check and refuses to 
> start since it can lead to incorrect data beeing inserted into the 
> database.
> 
> It is not possible to revert back to an earlier version. You can only do 
> this if you have made a backup of the database.
> 
> /Nicklas
> 
>> ----------
>> [75%]   Updating database...
>> [87%]   --Updating schema version: 28 -> 29...12:06:13,579 ERROR 
>> Update:1150 - updateToSchemaVersion29: FAILED
>> net.sf.basedb.core.BaseException: Object with id: 1 was not of the 
>> specified subclass: net.sf.basedb.core.data.MeasuredBioMaterialData 
>> (Discriminator: 0)
>>         at 
>> net.sf.basedb.core.HibernateUtil.loadList(HibernateUtil.java:1355)
>>         at 
>> net.sf.basedb.core.Update.updateToSchemaVersion29(Update.java:1105)
>>         at net.sf.basedb.core.Update.updateDatabase(Update.java:504)
>>         at net.sf.basedb.install.InitDB.main(InitDB.java:69)
>> Caused by: org.hibernate.WrongClassException: Object with id: 1 was not 
>> of the specified subclass: 
>> net.sf.basedb.core.data.MeasuredBioMaterialData (Discriminator: 0)
>>         at org.hibernate.loader.Loader.getInstanceClass(Loader.java:1444)
>>         at 
>> org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1275)
>>         at org.hibernate.loader.Loader.getRow(Loader.java:1197)
>>         at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:568)
>>         at org.hibernate.loader.Loader.doQuery(Loader.java:689)
>>         at 
>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
>>         at org.hibernate.loader.Loader.doList(Loader.java:2211)
>>         at 
>> org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
>>         at org.hibernate.loader.Loader.list(Loader.java:2090)
>>         at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
>>         at 
>> org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
>>         at 
>> org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
>>         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
>>         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
>>         at 
>> net.sf.basedb.core.HibernateUtil.loadList(HibernateUtil.java:1351)
>>         ... 3 more
>>
>> [90%]   Database update failed: Object with id: 1 was not of the 
>> specified subclass: net.sf.basedb.core.data.MeasuredBioMaterialData 
>> (Discriminator: 0)
>>
>>
>> net.sf.basedb.core.BaseException: Object with id: 1 was not of the 
>> specified subclass: net.sf.basedb.core.data.MeasuredBioMaterialData 
>> (Discriminator: 0)
>>         at 
>> net.sf.basedb.core.HibernateUtil.loadList(HibernateUtil.java:1355)
>>         at 
>> net.sf.basedb.core.Update.updateToSchemaVersion29(Update.java:1105)
>>         at net.sf.basedb.core.Update.updateDatabase(Update.java:504)
>>         at net.sf.basedb.install.InitDB.main(InitDB.java:69)
>> Caused by: org.hibernate.WrongClassException: Object with id: 1 was not 
>> of the specified subclass: 
>> net.sf.basedb.core.data.MeasuredBioMaterialData (Discriminator: 0)
>>         at org.hibernate.loader.Loader.getInstanceClass(Loader.java:1444)
>>         at 
>> org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1275)
>>         at org.hibernate.loader.Loader.getRow(Loader.java:1197)
>>         at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:568)
>>         at org.hibernate.loader.Loader.doQuery(Loader.java:689)
>>         at 
>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
>>         at org.hibernate.loader.Loader.doList(Loader.java:2211)
>>         at 
>> org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
>>         at org.hibernate.loader.Loader.list(Loader.java:2090)
>>         at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
>>         at 
>> org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
>>         at 
>> org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
>>         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
>>         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
>>         at 
>> net.sf.basedb.core.HibernateUtil.loadList(HibernateUtil.java:1351)
>>         ... 3 more
>> ----------
>>
>> First, what could this be?  I'm running a mysql database, the 
>> base.config is set up properly, and no BASE files have ever been 
>> modified--it's a very vanilla installation.  It seemed like a minor 
>> error, so I just switched back to my old 2.1.1 installation (switching 
>> folders, ensuring the www link in my tomcat webapp directory was 
>> correct).  I ran updatedb.sh on that install (perhaps mistakenly), and 
>> got a error from it, as follows.
>>
>> ----------
>> [75%]   Updating database...
>> [90%]   Database updated successfully.
>> [95%]   Installing web application...12:15:20,332 ERROR Application:401 
>> - Schema version mismatch: database schema version=28; expected=20; 
>> Please update the BASE code before starting.
>>
>>
>> net.sf.basedb.core.BaseException: Schema version mismatch: database 
>> schema version=28; expected=20; Please update the BASE code before starting.
>>         at net.sf.basedb.core.Application.start(Application.java:402)
>>         at net.sf.basedb.core.Application.start(Application.java:317)
>>         at net.sf.basedb.install.Webclient.install(Webclient.java:92)
>>         at net.sf.basedb.install.InitDB.main(InitDB.java:72)
>> ----------
>>
>>
>> If it's reporting a successful database update, I would think the schema 
>> version would have to be consistent, so the mismatch at the last step 
>> doesn't make sense.  Ignoring the error and attempting to load the BASE 
>> interface returns the following 500 server error:
>>
>> ----------
>>
>> type Exception report
>> message
>> description The server encountered an internal error () that prevented 
>> it from fulfilling this request.
>> exception
>>
>> net.sf.basedb.core.BaseException: Schema version mismatch: database 
>> schema version=28; expected=20; Please update the BASE code before starting.
>>     net.sf.basedb.core.Application.start(Application.java:402)
>>     net.sf.basedb.core.Application.start(Application.java:301)
>>     net.sf.basedb.core.Application.getSessionControl(Application.java:736)
>>     net.sf.basedb.clients.web.Base.getSessionControl(Base.java:111)
>>     org.apache.jsp.index_jsp._jspService(index_jsp.java:66)
>>     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>     
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
>>     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
>>     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>     
>> net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:71)
>>
>> ----------
>>
>> So 2.2's update script will update the version 28 to 29 (by the looks of 
>> it) except it isn't working on my install--did it update the schema 
>> earlier in the script (to 28), so that the database is no longer 
>> compatible with the 2.1.1 version (which appears to want version 20)?  
>> If the 2.2 update isn't an obvious fix, is there a way to revert to the 
>> 2.1 schema?  Thanks.
>>
>> --Chris Wiita
>>
>> -------------------------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job 
>> easier.
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> The BASE general discussion mailing list
>> basedb-users@lists.sourceforge.net
>> unsubscribe: send a mail with subject "unsubscribe" to
>> [EMAIL PROTECTED]
> 
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> The BASE general discussion mailing list
> basedb-users@lists.sourceforge.net
> unsubscribe: send a mail with subject "unsubscribe" to
> [EMAIL PROTECTED]

-- 
Jari Hakkinen, PhD
Complex Systems Division                        mailto:[EMAIL PROTECTED]
Department of Theoretical Physics               phone: +46 (0)46 2229347
Lund University                                 fax:   +46 (0)46 2229686
Solvegatan 14a, SE-223 62 Lund, Sweden          http://www.thep.lu.se

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
The BASE general discussion mailing list
basedb-users@lists.sourceforge.net
unsubscribe: send a mail with subject "unsubscribe" to
[EMAIL PROTECTED]

Reply via email to