Category: Database


Happen on version 5.1.7, so switch back to 5.1.6 is the solution…

From http://bugs.mysql.com/bug.php?id=41448

Bug #41448 java.sql.SQLException: !Statement.GeneratedKeysNotRequested!
Submitted: 13 Dec 2008 18:22 Modified: 28 May 20:29
Reporter: Rico H.
Status: Documenting
Category: Connector/J Severity: S1 (Critical)
Version: 5.1.7 OS: Linux
Assigned to: Target Version:
[13 Dec 2008 18:22] Rico H.
Description:
Hello,

Consider the following code:

PreparedStatement ps = connection.prepareStatement("INSERT INTO table values(?,?)");
ps.setInt(1,value1);
ps.setInt(2,value2);
ps.executeUpdate();
ResultSet rs = ps.getGeneratedKeys(); // This throws a java.sql.SQLException:
!Statement.GeneratedKeysNotRequested!

Even when creating the PreparedStament in this other way the same exception is thrown:

PreparedStatement ps = connection.prepareStatement("INSERT INTO table
values(?,?)",PreparedStatement.RETURN_GENERATED_KEYS);
ps.setInt(1,value1);
ps.setInt(2,value2);
ps.executeUpdate();
ResultSet rs = ps.getGeneratedKeys(); // This ALSO throws a java.sql.SQLException:
!Statement.GeneratedKeysNotRequested!

According to some posts I read on the Internet, this might be related to Bug #34185, as it
seems was pushed into the current 5.1.7 version and the problem didn't happen before.

I guess the problem just occurs when using PreparedStaments, as with Statements you can
provide the RETURN_GENERATED_KEYS flag when executing the query. However, flags for
PreparedStaments can only be provided when "Preparing the Statement". So the following
code works well:

Statement stmt =
connection.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,java.sql.ResultSet.CONCUR_
READ_ONLY);
stmt.executeUpdate("INSERT INTO table values(1,2)",Statement.RETURN_GENERATED_KEYS);
ResultSet rs = stmt.getGeneratedKeys(); //This works

This is breaking lots of apps, and should be fixed as soon as possible.

Thank you very much!!

How to repeat:
See description!

From http://support.microsoft.com/default.aspx?kbid=184988

function loadTOCNode(){}

Article ID : 184988
Last Review : January 22, 2007
Revision : 3.1
This article was previously published under Q184988
Novice: Requires knowledge of the user interface on single-user computers.

SYMPTOMS

loadTOCNode(1, ‘symptoms’);

When you try to open a database or an object in a database, or when you try to compact a database, you may receive one of the following error messages:

Selected collating sequence not supported by the operating system.
Invalid collating sequence.
Unrecognized database format ‘<pathname>\<filename>’.

CAUSE

loadTOCNode(1, ’cause’);

One of the following conditions is true:

You are trying to open a database or an object in a database that was created in another language edition of Microsoft Access.
You are trying to open a database that was created or compacted while the New Database Sort Order was set to a value other than General.

To check the setting of the New Database Sort Order, follow these steps:

1. Open an existing database that was not created or compacted while the Sort Order was set to a value other than General. For example, open the sample database Northwind.mdb.
2. On the Tools menu, click Options, and then click the General tab.
3. Make sure that the New Database Sort Order is set to General and then click OK.If you are receiving the errors described in the “Symptoms” section, setting the New Database Sort Order back to General does not resolve the problem; however, it prevents the problem from occurring with new databases.

RESOLUTION

loadTOCNode(1, ‘resolution’);

Install or enable multilanguage support for your operating system.NOTE: Even if you install multilanguage support, you cannot open a database if it requires a code page that is not supported by your operating system. For more information, please see the following article in the Microsoft Knowledge Base:

142867 (http://support.microsoft.com/kb/142867/EN-US/) ACC: Mixing Language Editions of Microsoft Access and Windows

If the database was created in a language that uses a type of character set supported by your operating system, you can open the database after you have enabled support for multiple languages.

To install multilanguage support in Windows 95/98 or Windows NT, please follow the steps in one of the following articles in the Microsoft Knowledge Base:

141306 (http://support.microsoft.com/kb/141306/EN-US/) How to Enable Support for Multiple Languages in Windows

177561 (http://support.microsoft.com/kb/177561/EN-US/) HOWTO: Add and Enable Additional Languages in Windows NT

Note: This feature is included in the CD-ROM version of Windows 95, but not in the floppy disk version. If you are using the floppy disk version of Windows 95 and you want to enable multilanguage support, please see the following article in the Microsoft Knowledge Base:

135315 (http://support.microsoft.com/kb/135315/EN-US/) CD-ROM Extras for Microsoft Windows 95 Upgrade

REFERENCES

loadTOCNode(1, ‘references’);

For more information about mixing language editions of Microsoft Access and Windows, please see the following articles in the Microsoft Knowledge Base:140409 (http://support.microsoft.com/kb/140409/EN-US/) ACC: Code Pages (Character Sets) & How They Affect MS Access

133381 (http://support.microsoft.com/kb/133381/EN-US/) ACC: How the Windows Code Page Affects Sort Order


APPLIES TO
Microsoft Access 95 Standard Edition
Microsoft Access 97 Standard Edition

Keywords:
kberrmsg kbprb KB184988

MySQL error 1017: errno: 24

From Re: Mysqldump error 1017: errno: 24 - help?
Yep, that seems to have done it, at least when I'm testing it.  I'm
pretty sure the problem is fixed, but the next couple of days of
automated backups will tell.

Thanks!

On Tue, 2005-01-11 at 00:43, Gleb Paharenko wrote:
> Hello.
>
> Try '--open-files-limit=8192' at least. Check the real value of
> open_file_limits with such statement:
>   show variables like '%open_f%';
>
> You can find some recommendations for SuSe Linux at:
>   http://dev.mysql.com/doc/mysql/en/Linux-post-install.html
>
> Mysql user <mysql@stripped> wrote:
> > Hi..
> >
> > I've got an ISP, and all of our customers have databases in our mysql
> > system.
> >
> > My backup command is:
> >
> > mysqldump --force --opt -A -pxxxxxxxx' | gzip -c >
> > /var/sqlbackup/mysqldump-`date +\%A`.sql.gz
> >
> > This has worked fine for some time.
> >
> > Now, however, I get an error message:
> >
> > mysqldump: Got error: 1017: Can't find file:
> > './usr_web22_1/invoices_va.frm' (errno: 24) when using LOCK TABLES
> >
> > On different runs, it reports different files, even right after
> > restarting mysqld.
> >
> > I've looked at the mysql documentation for this error; it's at
> > http://dev.mysql.com/doc/mysql/en/Not_enough_file_handles.html
> >
> > I've looked at the startup script, put in '--open-files-limit=1024',
> > restarted mysql, and the error is the same.
> >
> > I've looked at the table_cache and max_connections system variables,
> > which are 64 and 100, respectively.
> >
> > My question is: what should I do now?
> >
> > Since table_cache and max_connections are far less than 1024, do I
> > reduce them even further?
> > Is there something else I should be looking at?
> >
> > This is mysql-3.23.52-106 on SuSE Linux 8.1, running on a dual PIII
> > 866Mhz system, with 512M of ram and 1G of swap, on a RAID-1 pair of 17G
> > hard drives.
> >
> > Thanks!
> >
> >
>
>
> --
> For technical support contracts, goto https://order.mysql.com/?ref=ensita
> This email is sponsored by Ensita.NET http://www.ensita.net/
>    __  ___     ___ ____  __
>   /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
>  / /|_/ / // /\ \/ /_/ / /__   Gleb.Paharenko@stripped
> /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
>        <___/   www.mysql.com
> 
Powered by WordPress. Theme: Motion by 85ideas.