Hi,
I've been trying to battle this problem for a while, and unfortunately can't quite figure out the cause.
I am running on latest of Play 2.0 (build from sources), but I've experienced this with an earlier version of 2.0 - so don't think this is a very recent issue (if it isn't a silly oversight on my part).
I've isolated the offending query. It looks like whenever SQL("""<very long statement>""") is executed, play gets unhappy and throws a StackOverflowError (see exception stack trace below).
- Same query executes *fine* when executed directly against the DB.
- When I reduced query string size for the text column values, query executed fine.
- Original query size (as in, the statement provided to SQL() wrapper) was 3508 characters, a sample query that executed fine was ~2K characters in size.
If there is a max size of a query string that anorm can handle, and if so, is there a way to get around that max size?
Thanks for your help
-greg
This is my table structure, some column names obfuscated:
CREATE TABLE `CommunityRank` (
`userId` bigint(20) NOT NULL,
`communityId` bigint(20) NOT NULL,
`currentPoints` int(11) NOT NULL DEFAULT '0',
`previousPoints` int(11) NOT NULL DEFAULT '0',
`oldestDate` date NOT NULL,
`newestDate` date NOT NULL,
`someText1` text NOT NULL,
`someText2` text NOT NULL,
`modifiedTs` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`userId`,`communityId`),
KEY `indexCommunityRankUserId` (`userId`),
KEY `indexCommunityRankCommunityId` (`communityId`),
KEY `indexCommunityRankRanking` (`communityId`,`currentPoints`,`oldestDate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
/*!50100 PARTITION BY HASH (communityId)
PARTITIONS 1000 */;
Exception:
play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[StackOverflowError: null]]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:82) [play_2.9.1-2.0.jar:2.0]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:63) [play_2.9.1-2.0.jar:2.0]
at akka.actor.Actor$class.apply(Actor.scala:290) [akka-actor-2.0.jar:2.0]
at play.core.ActionInvoker.apply(Invoker.scala:61) [play_2.9.1-2.0.jar:2.0]
at akka.actor.ActorCell.invoke(ActorCell.scala:617) [akka-actor-2.0.jar:2.0]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:179) [akka-actor-2.0.jar:2.0]
at akka.dispatch.Mailbox.run(Mailbox.scala:161) [akka-actor-2.0.jar:2.0]
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:505) [akka-actor-2.0.jar:2.0]
at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) [akka-actor-2.0.jar:2.0]
at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:997) [akka-actor-2.0.jar:2.0]
at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1495) [akka-actor-2.0.jar:2.0]
at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) [akka-actor-2.0.jar:2.0]
java.lang.StackOverflowError: null
at java.util.regex.Pattern$Loop.match(Pattern.java:4275) ~[na:1.6.0_31]
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227) ~[na:1.6.0_31]
at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078) ~[na:1.6.0_31]
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345) ~[na:1.6.0_31]
at java.util.regex.Pattern$Branch.match(Pattern.java:4114) ~[na:1.6.0_31]
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168) ~[na:1.6.0_31]
at java.util.regex.Pattern$Loop.match(Pattern.java:4295) ~[na:1.6.0_31]
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227) ~[na:1.6.0_31]
at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078) ~[na:1.6.0_31]
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345) ~[na:1.6.0_31]
at java.util.regex.Pattern$Branch.match(Pattern.java:4114) ~[na:1.6.0_31]
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168) ~[na:1.6.0_31]
at java.util.regex.Pattern$Loop.match(Pattern.java:4295) ~[na:1.6.0_31]