[xwiki-devs] increasing low size-limit on XWiki.JavaScriptExtension[] data in object-editor ?
In 1.8, if too much data is entered in a doc's ?editor=object fieldXWiki.JavaScriptExtension[] (say a big chunk of JSON on the order of 97783 bytes) you can no longer save without getting an underlying error. This appears related to the following: com.xpn.xwiki.objects.LargeStringProperty --> com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'XWL_VALUE' at row 1 How can this be changed to allow for a larger limit on entries? Fortunately, http://nielsmayer.com/xwiki/bin/view/Exhibit/Presidents3 ( src <http://nielsmayer.com/xwiki/bin/download/Exhibit/Presidents3/Exhibit.Presidents3.xar>) has entries small enough, but as you grow the amount of Javascript data you hold in a XWiki.JavaScriptExtension you eventually get a failure like this: A problem occured while trying to process your request. Please contact the
webmaster if this happens again.
Detailed information:
Error number 3201 in 3: Exception while saving document Exhibit.pods Wrapped Exception: could not update: [com.xpn.xwiki.objects.LargeStringProperty#component[id,name]{id=-2025184002, name=code}] com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document Exhibit.pods Wrapped Exception: could not update: [com.xpn.xwiki.objects.LargeStringProperty#component[id,name]{id=-2025184002, name=code}] at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:595) at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:135) at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:128) at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1282) at com.xpn.xwiki.web.SaveAction.save(SaveAction.java:176) at com.xpn.xwiki.web.SaveAndContinueAction.action(SaveAndContinueAction.java:64) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:215) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
...
Wrapped Exception:
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'XWL_VALUE' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2983) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) at com.mysql.jdbc.Connection.execSQL(Connection.java:3256) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1585) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1500) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1485) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2412) at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2312) at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2612) at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:96) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:866) at com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:837) at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:585) at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:135) at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:128) at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1282) at com.xpn.xwiki.web.SaveAction.save(SaveAction.java:176) at com.xpn.xwiki.web.SaveAndContinueAction.action(SaveAndContinueAction.java:64)
Thanks. Niels http://nielsmayer.com
Niels Mayer wrote:
In 1.8, if too much data is entered in a doc's ?editor=object fieldXWiki.JavaScriptExtension[] (say a big chunk of JSON on the order of 97783 bytes) you can no longer save without getting an underlying error. This appears related to the following: com.xpn.xwiki.objects.LargeStringProperty --> com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'XWL_VALUE' at row 1
How can this be changed to allow for a larger limit on entries? Fortunately, http://nielsmayer.com/xwiki/bin/view/Exhibit/Presidents3 ( src <http://nielsmayer.com/xwiki/bin/download/Exhibit/Presidents3/Exhibit.Presidents3.xar>) has entries small enough, but as you grow the amount of Javascript data you hold in a XWiki.JavaScriptExtension you eventually get a failure like this:
This is a LargeStringProperty, which by defaults is configured to hold at least 60000 chars. In mysql, this translates to a TEXT column, which can hold 65,535 characters. Locally, you can alter the xwikilargestrings table to convert the XWL_VALUE column to MEDIUMTEXT to get past this issue. Globally, we can consider increasing the size for this field, but I don't know if it's a good idea. You should keep your files small. On the other hand, this also affects other objects, so for example long blog articles won't fit. Another idea is to put the file as an attachment on the skin document, or in the filesystem, and call it with the jsfx plugin instead of the jsx one. The drawback is that it will be a bit harder to edit, as you will need to change it locally and then re-attach it. -- Sergiu Dumitriu http://purl.org/net/sergiu/
Sergiu -- Thanks for the hints. For now, I'm going to stay lazy&compatible and just split the data into multiple ~60K chunks, then cobble it all together in JS before sending it off to Exhibit... it'll still be faster that way than sticking the data in a separate document or attachment, requiring a separate connection/lookup/request/response/parsing/etc... For example, here ( http://nielsmayer.com/xwiki/bin/view/Exhibit/pods ) I can only fit half the data and two points of the map/geolocation data, but at least it's beginning to work. I'll worry about adding the other half of the data later :-) In the long run, I plan to turn parsing "on" in XWiki.JavaScriptExtension[0] and use velocity loops and xwiki database lookups to create the JSON data directly in Xwiki. Then I will no longer be needing such long static JSON data. Niels http://nielsmayer.com Ps: It would be trivial to build nifty ajaxy search/navigation/hierarchy browsers into Xwiki w/ Exhibit, and it saves a lot of time on tedious ajax programming once you get used to it. It is quite awesome at what it does, and lets things stay at a nice high/abstract level. On Tue, May 12, 2009 at 2:32 PM, Sergiu Dumitriu <[email protected]> wrote:
Niels Mayer wrote:
In 1.8, if too much data is entered in a doc's ?editor=object fieldXWiki.JavaScriptExtension[] (say a big chunk of JSON on the order of 97783 bytes) you can no longer save without getting an underlying error. This appears related to the following: com.xpn.xwiki.objects.LargeStringProperty --> com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'XWL_VALUE' at row 1
How can this be changed to allow for a larger limit on entries? Fortunately, http://nielsmayer.com/xwiki/bin/view/Exhibit/Presidents3 ( src < http://nielsmayer.com/xwiki/bin/download/Exhibit/Presidents3/Exhibit.Preside... ) has entries small enough, but as you grow the amount of Javascript data you hold in a XWiki.JavaScriptExtension you eventually get a failure like this:
This is a LargeStringProperty, which by defaults is configured to hold at least 60000 chars. In mysql, this translates to a TEXT column, which can hold 65,535 characters.
Locally, you can alter the xwikilargestrings table to convert the XWL_VALUE column to MEDIUMTEXT to get past this issue.
Globally, we can consider increasing the size for this field, but I don't know if it's a good idea. You should keep your files small. On the other hand, this also affects other objects, so for example long blog articles won't fit.
Another idea is to put the file as an attachment on the skin document, or in the filesystem, and call it with the jsfx plugin instead of the jsx one. The drawback is that it will be a bit harder to edit, as you will need to change it locally and then re-attach it. -- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (2)
-
Niels Mayer -
Sergiu Dumitriu