[Building Sakai] nightly trunk down

Noah Botimer botimer at umich.edu
Wed Jun 27 06:50:50 PDT 2012


Really, we should avoid LONG columns completely. They mostly work, but VARCHAR2 and CLOB behave better and aren't deprecated. There is a straightforward conversion if you have LONG fields already.

With Oracle, the boundary is 4000, so anything that could end up being "quite long", like HTML fields, should be a CLOB out of the gate.

It looks like there were updates for 3.5/3.6 that changed the handling, forcing text -> LONG for Oracle. There is some debate on whether this is the right choice [4][5]. However, there is a new data type, "materialized_clob", which appears to do what we want for Oracle (CLOB in DB, String in Java). It would need testing, but I think it will also work properly for MySQL. (The text type maps as Java's LONGVARCHAR, which goes to the CLOB types already in MySQL, so it should not reflect a change, provided the length limit doesn't change and exceed an existing mapping like TEXT (<65kb) vs. MEDIUMTEXT).

There are alternate approaches, including customizing the dialect and implementing a user type. One of these may be a single-point solution, but I don't know enough about them to prefer one now.

Thanks,
-Noah

[1] https://hibernate.onjira.com/browse/HHH-3892
[2] https://community.jboss.org/wiki/HibernateCoreMigrationGuide35
[3] https://community.jboss.org/wiki/HibernateCoreMigrationGuide36
[4] https://hibernate.onjira.com/browse/HHH-5569
[5] http://stackoverflow.com/questions/3719905/why-has-hibernate-switched-to-use-long-over-clob

On Jun 27, 2012, at 8:37 AM, David Horwitz wrote:

> OK so the solution I found documented on the web didn't work. Is there anyone with some time and access to oracle who can look into this?
> 
> I'm on holiday from tomorrow ....
> 
> D
> On 06/27/2012 12:58 PM, David Horwitz wrote:
>> Hi All,
>> 
>> Under https://jira.sakaiproject.org/browse/SAK-22339 I've been takling the oracle syntax issue. Basicaly as the hbm type text is mapped to long you can only have 1 text type column. The workarround is rather to specify a text type with a very long length that is mapped to clob.
>> 
>> I will wait for the next nighty build to see if this addresses the code I've touched before tackling the last few (poll, msgcntr, sst). I've tested on mysql but don't have oracle to test on ...
>> 
>> D
>> 
>> On 06/27/2012 10:33 AM, David Horwitz wrote:
>>> Ok 
>>> 
>>> I have fixed the Message Forums issue (actually in common) - It was a 1 line fix. Simply if you do code level caching you now have to specify the cache region:
>>> 
>>> q.setCacheRegion(Type.class.getCanonicalName());
>>> 
>>> I can't reproduce the chat problem - the issue I had on my local build is that it seems to expect jstl to be in shared - when I deployed it to the webapp this seemed to work.
>>> 
>>> I see a lot of table creation issues on nightly so will do an empty db startup on my local to see if i can reproduce....
>>> 
>>> D
>>> 
>>> 
>>> On 06/27/2012 05:48 AM, Steve Swinsburg wrote:
>>>> The lines of code in chat and forums point to use of the HibernateTemplate, which then triggers it all so I'm thinking it might be in the config of that/session factory etc.
>>>> 
>>>> -S
>>>> 
>>>> 
>>>> On 27/06/2012, at 12:42 PM, Aaron Zeckoski wrote:
>>>> 
>>>>> 300 public void secondLevelCachePut(String regionName) {
>>>>> 301		secondLevelCachePutCount.getAndIncrement();
>>>>> 302		( (ConcurrentSecondLevelCacheStatisticsImpl)
>>>>> getSecondLevelCacheStatistics( regionName ) ).incrementPutCount();
>>>>> 303	}
>>>>> 
>>>>> Looks like maybe there is something wrong with the cache at a quick
>>>>> glance. Maybe the hibernate SF is configured wrong or something?
>>>>> -AZ
>>>>> 
>>>>> 
>>>>> On Tue, Jun 26, 2012 at 10:03 PM, Steve Swinsburg
>>>>> <steve.swinsburg at gmail.com> wrote:
>>>>>> Ok the HQL in MSGCNTR is fixed and checked in at r109719. This allows trunk
>>>>>> to startup. Difficult to test though since the tool doesn't work...
>>>>>> 
>>>>>> Other tools (eg chat) exhibit the same error. Still related to hibernate
>>>>>> though...
>>>>>> 
>>>>>> https://jira.sakaiproject.org/browse/SAK-22336
>>>>>> 
>>>>>> -S
>>>>>> 
>>>>>> org.sakaiproject.portal.api.PortalHandlerException:
>>>>>> org.sakaiproject.tool.api.ToolException: org.apache.jasper.JasperException:
>>>>>> javax.servlet.ServletException: javax.servlet.jsp.JspException:
>>>>>> javax.faces.el.EvaluationException: javax.faces.el.EvaluationException:
>>>>>> Error getting property 'template' from bean of type
>>>>>> org.sakaiproject.tool.messageforums.DiscussionForumTool:
>>>>>> java.lang.NullPointerException
>>>>>>    at
>>>>>> org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:880)
>>>>>> caused by: org.sakaiproject.tool.api.ToolException:
>>>>>> org.apache.jasper.JasperException: javax.servlet.ServletException:
>>>>>> javax.servlet.jsp.JspException: javax.faces.el.EvaluationException:
>>>>>> javax.faces.el.EvaluationException: Error getting property 'template' from
>>>>>> bean of type org.sakaiproject.tool.messageforums.DiscussionForumTool:
>>>>>> java.lang.NullPointerException
>>>>>>    at
>>>>>> org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1461)
>>>>>> caused by: org.apache.jasper.JasperException:
>>>>>> javax.servlet.ServletException: javax.servlet.jsp.JspException:
>>>>>> javax.faces.el.EvaluationException: javax.faces.el.EvaluationException:
>>>>>> Error getting property 'template' from bean of type
>>>>>> org.sakaiproject.tool.messageforums.DiscussionForumTool:
>>>>>> java.lang.NullPointerException
>>>>>>    at
>>>>>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:442)
>>>>>> caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException:
>>>>>> javax.faces.el.EvaluationException: javax.faces.el.EvaluationException:
>>>>>> Error getting property 'template' from bean of type
>>>>>> org.sakaiproject.tool.messageforums.DiscussionForumTool:
>>>>>> java.lang.NullPointerException
>>>>>>    at
>>>>>> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:840)
>>>>>> caused by: javax.faces.el.EvaluationException:
>>>>>> javax.faces.el.EvaluationException: Error getting property 'template' from
>>>>>> bean of type org.sakaiproject.tool.messageforums.DiscussionForumTool:
>>>>>> java.lang.NullPointerException
>>>>>>    at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:143)
>>>>>> caused by: javax.faces.el.EvaluationException: Error getting property
>>>>>> 'template' from bean of type
>>>>>> org.sakaiproject.tool.messageforums.DiscussionForumTool:
>>>>>> java.lang.NullPointerException
>>>>>>    at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:187)
>>>>>> caused by: java.lang.NullPointerException
>>>>>>    at
>>>>>> org.hibernate.stat.ConcurrentStatisticsImpl.secondLevelCachePut(ConcurrentStatisticsImpl.java:302)
>>>>>>    at
>>>>>> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:189)
>>>>>>    at
>>>>>> org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:898)
>>>>>>    at org.hibernate.loader.Loader.doQuery(Loader.java:773)
>>>>>>    at
>>>>>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
>>>>>>    at org.hibernate.loader.Loader.doList(Loader.java:2449)
>>>>>>    at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2235)
>>>>>>    at org.hibernate.loader.Loader.list(Loader.java:2184)
>>>>>>    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)
>>>>>>    at
>>>>>> org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
>>>>>>    at
>>>>>> org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
>>>>>>    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)
>>>>>>    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
>>>>>>    at
>>>>>> org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:859)
>>>>>>    at
>>>>>> org.sakaiproject.component.common.type.TypeManagerImpl$2.doInHibernate(TypeManagerImpl.java:192)
>>>>>>    at
>>>>>> org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
>>>>>>    at
>>>>>> org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
>>>>>>    at
>>>>>> org.sakaiproject.component.common.type.TypeManagerImpl.getType(TypeManagerImpl.java:195)
>>>>>>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>    at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>>>    at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>    at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On 27/06/2012, at 11:52 AM, Steve Swinsburg wrote:
>>>>>> 
>>>>>> I think I have a fix for msgcntr. Stay tuned.
>>>>>> 
>>>>>> 
>>>>>> On 27/06/2012, at 11:51 AM, Maurer, Christopher Wayne wrote:
>>>>>> 
>>>>>> Couldn't we just pull msgcntr out of the trunk build until someone is able
>>>>>> 
>>>>>> to fix it?  Probably easier than reverting the whole hibernate change.
>>>>>> 
>>>>>> Just a thought.
>>>>>> 
>>>>>> 
>>>>>> Chris
>>>>>> 
>>>>>> 
>>>>>> On 6/26/12 9:29 PM, "Steve Swinsburg" <steve.swinsburg at gmail.com> wrote:
>>>>>> 
>>>>>> 
>>>>>> I've raised a JIRA for the msgcntr query fix:
>>>>>> 
>>>>>> https://jira.sakaiproject.org/browse/MSGCNTR-686
>>>>>> 
>>>>>> 
>>>>>> I removed all msgcntr artifacts from Tomcat and restarted, and it came up
>>>>>> 
>>>>>> ok. So I think msgcntr is the only app that has an issue. Should the
>>>>>> 
>>>>>> hibernate upgrade be backed out until msgcntr is fixed?
>>>>>> 
>>>>>> 
>>>>>> cheers,
>>>>>> 
>>>>>> S
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On 27/06/2012, at 10:33 AM, Charles Severance wrote:
>>>>>> 
>>>>>> 
>>>>>> Aaron,
>>>>>> 
>>>>>> 
>>>>>> We can't have trunk broken for weeks as a form of motivation.  It would
>>>>>> 
>>>>>> be one thing if one or two tools were broken.   But as best I can tell -
>>>>>> 
>>>>>> it just won't come up at all.
>>>>>> 
>>>>>> 
>>>>>> /Chuck
>>>>>> 
>>>>>> 
>>>>>> On Jun 26, 2012, at 8:11 PM, Aaron Zeckoski wrote:
>>>>>> 
>>>>>> 
>>>>>> If only. It wasn't too terribly awful but like most things like this,
>>>>>> 
>>>>>> the time was not in typing in the changes but trying things until they
>>>>>> 
>>>>>> worked.
>>>>>> 
>>>>>> 
>>>>>> If someone wants to take this over and back it out and then reapply it
>>>>>> 
>>>>>> later that is fine with me but just a reminder that the hibernate
>>>>>> 
>>>>>> upgrade is a 2.9 blocker so the longer we wait on this the longer we
>>>>>> 
>>>>>> delay 2.9 release.
>>>>>> 
>>>>>> 
>>>>>> -AZ
>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> 
>>>>>> sakai-dev mailing list
>>>>>> 
>>>>>> sakai-dev at collab.sakaiproject.org
>>>>>> 
>>>>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>>>>> 
>>>>>> 
>>>>>> TO UNSUBSCRIBE: send email to
>>>>>> 
>>>>>> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
>>>>>> 
>>>>>> "unsubscribe"
>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> 
>>>>>> sakai-dev mailing list
>>>>>> 
>>>>>> sakai-dev at collab.sakaiproject.org
>>>>>> 
>>>>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>>>>> 
>>>>>> 
>>>>>> TO UNSUBSCRIBE: send email to
>>>>>> 
>>>>>> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
>>>>>> 
>>>>>> "unsubscribe"
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> sakai-dev mailing list
>>>>>> sakai-dev at collab.sakaiproject.org
>>>>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>>>>> 
>>>>>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org
>>>>>> with a subject of "unsubscribe"
>>>>> -- 
>>>>> Aaron Zeckoski - Software Architect - http://tinyurl.com/azprofile
>>>> _______________________________________________
>>>> sakai-dev mailing list
>>>> sakai-dev at collab.sakaiproject.org
>>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>>> 
>>>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
>>>> 
>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> sakai-dev mailing list
>>> sakai-dev at collab.sakaiproject.org
>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>> 
>>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
>> 
>> 
>> 
>> 
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org
>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>> 
>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
> 
> 
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20120627/e8a2554b/attachment.html 


More information about the sakai-dev mailing list