![]() |
Not that it is any newsflash, but same problems here. Both posting and editing.
-Kurt |
Avoid using SQL Keywords in posts. Those are what seem to be breaking the forums.
|
Originally Posted by Tom Stormcrowe
(Post 7042057)
Avoid using SQL Keywords in posts. Those are what seem to be breaking the forums.
|
of course Tom, you do know the following are SQL key words
AND OR WHERE :lol: |
Certain key words are apparently the ones doing it. Just not sure of the whole list of the ones causing it. Brillig and red house found the problem and by gum, they seem to be right.
Originally Posted by crtreedude
(Post 7042078)
of course Tom, you do know the following are SQL key words
:lol: |
I give up. What's an SQL keyword?
|
and they stopped me from being able to post just now until I removed them from your quote.
|
Originally Posted by noteon
(Post 7042100)
I give up. What's an SQL keyword?
|
Thanks.
That's pretty funny. |
It seems to be random scrubbing of the key words, even in sentences.
|
Are you sure about that, Tom?
_______________________________________ Begin to accept foreign percent select file password insert CREATE TABLE CREATE PROCEDURE findjobs @nm sysname = NULL AS IF @nm IS NULL BEGIN PRINT 'You must give a username' RETURN END ELSE BEGIN SELECT o.name, o.id, o.uid FROM sysobjects o INNER JOIN master..syslogins l ON o.uid = l.sid WHERE l.name = @nm Silly GORM tricks, part III: SQL keywords as attributes I was writing a very simple Grails application and ran into a problem when I accidentally used a SQL keyword as a property name. This post documents what happened, and how I (pretty easily) fixed it. To illustrate the issue, consider a trivial Grails application called “messaging” with a single class called Message. class Message { String from String to String text } This is supposed to represent a simple email message, with fields to represent the sender, the receiver, and the text of the message itself. It seemed quite logical at the time to use the words from, to, and text for the fields, but that leads to problems. I added a MessageController with dynamic scaffolding (i.e., def scaffold = Message) and started the server. When I accessed the MessageController link, however, I got org.hibernate.exception.SQLGrammarException: could not execute query In order to see the actual problem, I modified my DataSource.groovy file to add “loggingSql = true” in the dataSource section. After restarting the server, in the console window I saw that the exception was caused by a SQL command generated by the scaffolded list method in MessageController: Hibernate: select this_.id as id0_0_, this_.version as version0_0_, this_.from as from0_0_, this_.text as text0_0_, this_.to as to0_0_ from message this_ limit ? This statement looks fine, and in fact there’s nothing wrong with it. I couldn’t see the problem until I switched to MySQL so that I could browse the database independently. (Switching to another database is covered many places in the Grails literature. In short, it means adding the JDBC driver to the messaging/lib directory, creating the messaging database in MySQL, and changing the driverClassName, url, username, and password settings in DataSource.groovy.) When I did that and checked the database with the MySQL client, I found the problem (or at least a symptom of it): mysql> show tables; Empty set (0.00 sec) In other words, the problem was that the message table didn’t exist. Somehow the SQL used to generate the table in the first place didn’t work. Logging the SQL as I did wasn’t sufficient to show me the CREATE TABLE statement. If, however, I go into Config.groovy and change the value of log4j.logger.org.hibernate to debug, I see in the resulting console: [1125] hbm2ddl.SchemaExport create table message ( id bigint not null auto_increment, version bigint not null, from varchar(255) not null, text varchar(255) not null, to varchar(255) not null, primary key (id) ) followed immediately by [1125] hbm2ddl.SchemaExport Unsuccessful: create table message … [1125] hbm2ddl.SchemaExport You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘from varchar(255) not null, text varchar(255) not null, to varchar(255) not null’ at line 1 The problem is that the word “from” is a SQL keyword. MySQL got upset when I tried to use it in the create table statement, as shown above. How can I fix this? I could change the name of the from property, to, say, sender. Since Grails 1.0, however, GORM now has the ability to do custom ORM mappings, which feels like a cleaner way to solve the problem. Therefore, I added the following closure to my class: static mapping = { from column: 'sender' } Now the generated create statement is: [1157] hbm2ddl.SchemaExport create table message ( id bigint not null auto_increment, version bigint not null, sender varchar(255) not null, text varchar(255) not null, to varchar(255) not null, primary key (id) ) and the new error is [1157] hbm2ddl.SchemaExport You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘to varchar(255) not null, primary key (id))’ at line 1 So apparently the word “to” is also a problem. I therefore modified the mapping closure to include it as well: static mapping = { from column: 'sender' to column: 'receiver' } |
Like I said, it's random......:notamused:
|
Originally Posted by Tom Stormcrowe
(Post 7042322)
Like I said, it's random......:notamused:
|
Well, they do seem to have fixed it. I was just emailed by our webmaster and the issue was related. They addressed it, so let's see what happens. :D
|
Appears that the developers at my day job must have been working on our DB. ;)
|
Looks like! :D At least we're up and running again.
|
There's an ad on the right side that's trying to load, and it's causing a high CPU load and eating up memory in Firefox 3.0.1, and it causes an error message in IE 7: Stack overflow at line: 0. I think it's an HSN ad.
|
Originally Posted by carbonlife
(Post 7221098)
There's an ad on the right side that's trying to load, and it's causing a high CPU load and eating up memory in Firefox 3.0.1, and it causes an error message in IE 7: Stack overflow at line: 0. I think it's an HSN ad.
-Roger |
I do not have posting rights in the Politics & Religion forum. Does anyone know how it could be fixed? Thank you all in advance!
|
Originally Posted by rfomenko
(Post 7240418)
I do not have posting rights in the Politics & Religion forum. Does anyone know how it could be fixed? Thank you all in advance!
You have yet to be deemed worthy by the Oracle and it's Acolytes! When you enter the Temple of P&R you must pledge to uphold it's credo and standards and if THAT is not a timely remedy then Forum Moderation Priests must exorcise your demons.... If you answered yes in the login for P&R and were not accepted then you should find a moderator and have then explain why. P&R is restricted due to some really bad attitudes making it UNHOLY so they want those who behave well with others to keep the forum open and tenable. I'm surprised that I haven't located a sticky on this yet because I'm sure it's there and this is probably the most asked question here other that why is it taking so long to post and search? |
Originally Posted by CCrew
(Post 7227369)
I'm seeing the same thing. It's one of the ads in rotation in the right margin at the top. If I ack the error the ad hangs with the message "loading"
-Roger At any rate I would also offer that IE and Firefox are probably the most similar in heritage to Mosaic/Netscape and that would explain the problem occuring mostly in those two browsers. My two pence bumped to a quid for inflation. Your mileage may not seem indicative if you drive a huge lorry. |
Hi. I have recently joined, great community. I am having trouble searching by my user name, to find the threads or posts I have been involved in. Using the search function or clicking the find button next to my name in the member list have the same result, an error message telling me that what I am looking for cannot be found, and lists possible reasons, such as incorrect spelling or simply there ain't no such animal (not in those words...). Searching for other members' posts works fine, so it seems specific to myself. Wondering if the moderators could help on this one. Problem occured in different locations, on both PC and Mac.
Thanks a million |
Originally Posted by rocdoc
(Post 7271193)
Hi. I have recently joined, great community. I am having trouble searching by my user name, to find the threads or posts I have been involved in. Using the search function or clicking the find button next to my name in the member list have the same result, an error message telling me that what I am looking for cannot be found, and lists possible reasons, such as incorrect spelling or simply there ain't no such animal (not in those words...). Searching for other members' posts works fine, so it seems specific to myself. Wondering if the moderators could help on this one. Problem occured in different locations, on both PC and Mac.
Thanks a million |
Three words for the past few days: SLOW, SLOW, SLOW. Pages take fffffoooooorrrrrreeeeeevvvvveeeeerrrr to load, and I've lost a couple of posts (including an early version of this post.....
|
OK, somebody just did something right, the page loading speed went WAY up in the last few minutes...
|
| All times are GMT -6. The time now is 06:51 PM. |
Copyright © 2026 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.