Subject Firebird table field problem
Author Sanjay Amatya
I have a field name 'password' in a table X. During conversion from Access table,
the field name was automatically converted to 'passwordcol'. Looks like Firebird
doesn't allow 'password' as field name. I have an existing Java application with
more than a thousand classes, with complex relationships, and database tables mapped
as java objects. This makes it very difficult to change the field name in Java app
itself. What could be the best solution in such a situation? Any thoughts?

Thanks

--- Firebird-Java@yahoogroups.com wrote:
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
> ------------------------------------------------------------------------
>
> There are 16 messages in this issue.
>
> Topics in this digest:
>
> 1. problems on linux...
> From: Marczisovszky Daniel <marczi@...>
> 2. Re: problems on linux...
> From: David Jencks <davidjencks@...>
> 3. Result Set not returning all rows
> From: <kenr@...>
> 4. Re: problems on linux...
> From: "rrokytskyy" <rrokytskyy@...>
> 5. Re[2]: problems on linux...
> From: Marczisovszky Daniel <marczi@...>
> 6. Re: Re: problems on linux...
> From: Marczisovszky Daniel <marczi@...>
> 7. Re[2]: Re: problems on linux...
> From: Marczisovszky Daniel <marczi@...>
> 8. Re: problems on linux...
> From: "rrokytskyy" <rrokytskyy@...>
> 9. other mailing lists
> From: Marczisovszky Daniel <marczi@...>
> 10. Re: Re: problems on linux...
> From: Marczisovszky Daniel <marczi@...>
> 11. Re: Result Set not returning all rows
> From: "rrokytskyy" <rrokytskyy@...>
> 12. Re: Re: problems on linux...
> From: Marczisovszky Daniel <marczi@...>
> 13. Re: problems on linux...
> From: "rrokytskyy" <rrokytskyy@...>
> 14. Re: Re: problems on linux...
> From: Marczisovszky Daniel <marczi@...>
> 15. New experiences with the no-update and deadlock bug!
> From: Marczisovszky Daniel <marczi@...>
> 16. Re: New experiences with the no-update and deadlock bug!
> From: "rrokytskyy" <rrokytskyy@...>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 1
> Date: Sat, 13 Apr 2002 01:22:35 +0200
> From: Marczisovszky Daniel <marczi@...>
> Subject: problems on linux...
>
> Hi,
>
> Well, hm... I have serious problem again. The happens only on Linux. I
> have tested with both Classic and Superserver on a Debian Potato and
> on a Suse 7.2 with same results. The same is happening with both
> Interclient and the latest type4 driver.
>
> I get a connection and starts reading a record from it, periodically,
> but always on the same connection. If I change that record from isql,
> nothing happens, I still get the previous value for that record. I've
> also tried IBConsole but that did not help either. The interesting
> thing I tried QuickDesk and If I change the record with that, then I
> get the new value in the java program. I tried also with FIBPlus in
> Delphi (QuickDesk also uses FIBPlus) but the java still shows the
> previous value.
>
> I have attached a little example application. It reads the first
> record from test table in every 3 seconds always with the same
> connection. (I have tried both autocommit and non-autocommit, but none
> of them worked).
>
> It runs an infinite loop. While it prints it the first record, try to
> change that in isql or with IBConsole, and check if you see the new
> value or not. I don't see the change.
>
> I know that probably this is not a bug a driver, but I'm not sure,
> although I can't reproduce it on Windows. Does the driver contains any
> platform-specific part?
>
> If I change the value from java (e.g. I start a separate java program)
> then it works, it shows the new value.
>
> Is there any special isolation level for isql and IBConsole I missed?
>
> Please help, if you can! I really don't know how to cope with this.
>
> Best wishes,
> Daniel
>
> // same database as last time, so only it has an id, username and
> // passwd field
>
> import java.sql.*;
> import java.util.*;
>
> public class conn {
> public static void main( String[] args ) {
> try {
> Class.forName("org.firebirdsql.jdbc.FBDriver");
> String url =
> "jdbc:firebirdsql:localhost/3050://opt/interbase/test.gdb";
> //String url =
> "jdbc:firebirdsql:localhost/3050:/programs/develop/firebird/test.gdb";
>
> // we a get a connection
> Connection conn = DriverManager.getConnection(url, "sysdba",
> "masterkey");
> while (true) {
> Statement st = conn.createStatement();
> ResultSet rs = st.executeQuery("select username from test");
> rs.next();
> System.out.println(rs.getString(1));
> // wait 3 seconds and try again
> try {
> Thread.sleep(3000);
> }
> catch (Exception ee) {}
> }
> }
> catch(ClassNotFoundException e) {
> System.err.println("Couldn't load the driver: " + e.getMessage());
> }
> catch(SQLException e) {
> System.err.println("SQLException caught: " + e.getMessage());
> }
> finally {
> }
> }
> }
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 2
> Date: Fri, 12 Apr 2002 19:43:58 -0400
> From: David Jencks <davidjencks@...>
> Subject: Re: problems on linux...
>
> I ran into this a long time ago and never found a solution except not to
> use isql. I have no idea what is causing this. As you say, sticking
> entirely to the java drivers seems to work ok. I think closing isql may
> also make the changes visible??
>
> david jencks
>
> On 2002.04.12 19:22:35 -0400 Marczisovszky Daniel wrote:
> > Hi,
> >
> > Well, hm... I have serious problem again. The happens only on Linux. I
> > have tested with both Classic and Superserver on a Debian Potato and
> > on a Suse 7.2 with same results. The same is happening with both
> > Interclient and the latest type4 driver.
> >
> > I get a connection and starts reading a record from it, periodically,
> > but always on the same connection. If I change that record from isql,
> > nothing happens, I still get the previous value for that record. I've
> > also tried IBConsole but that did not help either. The interesting
> > thing I tried QuickDesk and If I change the record with that, then I
> > get the new value in the java program. I tried also with FIBPlus in
> > Delphi (QuickDesk also uses FIBPlus) but the java still shows the
> > previous value.
> >
> > I have attached a little example application. It reads the first
> > record from test table in every 3 seconds always with the same
> > connection. (I have tried both autocommit and non-autocommit, but none
> > of them worked).
> >
> > It runs an infinite loop. While it prints it the first record, try to
> > change that in isql or with IBConsole, and check if you see the new
> > value or not. I don't see the change.
> >
> > I know that probably this is not a bug a driver, but I'm not sure,
> > although I can't reproduce it on Windows. Does the driver contains any
> > platform-specific part?
> >
> > If I change the value from java (e.g. I start a separate java program)
> > then it works, it shows the new value.
> >
> > Is there any special isolation level for isql and IBConsole I missed?
> >
> > Please help, if you can! I really don't know how to cope with this.
> >
> > Best wishes,
> > Daniel
> >
> > // same database as last time, so only it has an id, username and
> > // passwd field
> >
> > import java.sql.*;
> > import java.util.*;
> >
> > public class conn {
> > public static void main( String[] args ) {
> > try {
> > Class.forName("org.firebirdsql.jdbc.FBDriver");
> > String url =
> "jdbc:firebirdsql:localhost/3050://opt/interbase/test.gdb";
> > //String url =
> "jdbc:firebirdsql:localhost/3050:/programs/develop/firebird/test.gdb";
> >
> > // we a get a connection
> > Connection conn = DriverManager.getConnection(url, "sysdba",
> > "masterkey");
> > while (true) {
> > Statement st = conn.createStatement();
> > ResultSet rs = st.executeQuery("select username from
> > test");
> > rs.next();
> > System.out.println(rs.getString(1));
> > // wait 3 seconds and try again
> > try {
> > Thread.sleep(3000);
> > }
> > catch (Exception ee) {}
> > }
> > }
> > catch(ClassNotFoundException e) {
> > System.err.println("Couldn't load the driver: " +
> > e.getMessage());
> > }
> > catch(SQLException e) {
> > System.err.println("SQLException caught: " + e.getMessage());
> > }
> > finally {
> > }
> > }
> > }
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > Firebird-Java-unsubscribe@yahoogroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> >
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 3
> Date: Fri, 12 Apr 2002 23:51:16 EDT
> From: <kenr@...>
> Subject: Result Set not returning all rows
>
> Here is a test case. Unzip the file to your client-java\src\org\firebirdsql\jdbc
> folder and then run build one-test -Dtest=CopyrightSymbol. I had to tweak my
> build.xml to get the one-test target to work correctly. The test and log are
> attached insize a zip file
>
> The test inserts four rows into a table. The third row contains a copyright
> symbol. When I select * only two rows are returned and no exceptions are thrown.
>
> In my larger program - I get gds synchronzation exceptions when I try to close the
> resultset and statements. I do not get these exceptions in the test case - but I
> am able to recreate the problem where not all rows are returned.
>
>
>
> [This message contained attachments]
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 4
> Date: Sat, 13 Apr 2002 07:47:00 -0000
> From: "rrokytskyy" <rrokytskyy@...>
> Subject: Re: problems on linux...
>
> > I ran into this a long time ago and never found a solution except
> > not to use isql. I have no idea what is causing this. As you say,
> > sticking entirely to the java drivers seems to work ok. I think
> > closing isql may also make the changes visible??
>
> I also had such a problem and never solved it either (I was using
> InterClient). Maybe you can try different transaction isolation level?
>
> Unfortunatelly I do not have Linux box to make new tests. Sorry.
>
> Best regards,
> Roman Rokytskyy
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 5
> Date: Sat, 13 Apr 2002 11:06:48 +0200
> From: Marczisovszky Daniel <marczi@...>
> Subject: Re[2]: problems on linux...
>
> DJ> I ran into this a long time ago and never found a solution except not to
> DJ> use isql. I have no idea what is causing this.� As you say, sticking
> DJ> entirely to the java drivers seems to work ok.� I think closing isql may
> DJ> also make the changes visible??
>
> no. it does not help at all. this is not a problem of isql. I've also
> tried with FIBPlus, IBX and ZeosLIB for Delphi and I could not update
> the database with any of them.
>
> Well, while I was playing with it, I found a more serious issue:
>
> I've added close statements to my code, which is absolutely correct
> according to the API.
>
> The original code was this
>
> Statement st = conn.createStatement();
> ResultSet rs = st.executeQuery("select username from test");
> rs.next();
> System.out.println(rs.getString(1));
> try {
> Thread.sleep(2000);
> }
> catch (Exception ee) {}
>
> and replaced with this:
>
> Statement st = conn.createStatement();
> ResultSet rs = st.executeQuery("select username from test");
> rs.next();
> System.out.println(rs.getString(1));
> rs.close();
> st.close();
> try {
> Thread.sleep(2000);
> }
> catch (Exception ee) {}
>
> So when I run this new test and I connect to the test.gdb (I only
> connect, I do not issue any sql command) then the java test hangs up.
> It stops, but I don't know where. I've attached the log file, the jave
> test ran three iterations, so it read the first record three times.
>
> David, don't you know personally someone from FB developers who has
> linux and may run this test? This is a joke, we can not have releases
> of a database system with such issues. This means one can not manage
> his database remotely, only with java. If it is the bug of Firebird,
> then this is a quite serious issue and should be fixed as soon as it
> is possible.
>
> It hangs up at a op_response according to the log, but I can not
> interpret it.
>
> Roman, I you tell me what would be required on a linux box for
> debugging, probably I could give an account. (although that linux box is
> not mine, but I will try everything to solve this)
>
> If it is the bug of the driver, I'm sure we can find it out, we're
> good :)
>
> Best wishes,
> Daniel
>
> [This message contained attachments]
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 6
> Date: Sat, 13 Apr 2002 11:08:10 +0200
> From: Marczisovszky Daniel <marczi@...>
> Subject: Re: Re: problems on linux...
>
> >> I ran into this a long time ago and never found a solution except
> >> not to use isql. I have no idea what is causing this.� As you say,
> >> sticking entirely to the java drivers seems to work ok.� I think
> >> closing isql may also make the changes visible??
>
> r> I also had such a problem and never solved it either (I was using
> r> InterClient). Maybe you can try different transaction isolation level?
>
> That was the first thing... :( Maybe this hang-up issue can help to
> find it out...
>
> daniel
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 7
> Date: Sat, 13 Apr 2002 11:25:29 +0200
> From: Marczisovszky Daniel <marczi@...>
> Subject: Re[2]: Re: problems on linux...
>
> I've also tried Interbase 6.01 open source edition, exactly the same
> behaviour. Maybe someone at Borland? ....
>
> daniel
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 8
> Date: Sat, 13 Apr 2002 10:19:06 -0000
> From: "rrokytskyy" <rrokytskyy@...>
> Subject: Re: problems on linux...
>
> > Well, while I was playing with it, I found a more serious issue:
> >
> > I've added close statements to my code, which is absolutely correct
> > according to the API.
> >
> > The original code was this
> >
> > Statement st = conn.createStatement();
> > ResultSet rs = st.executeQuery("select username
> from test");
> > rs.next();
> > System.out.println(rs.getString(1));
> > try {
> > Thread.sleep(2000);
> > }
> > catch (Exception ee) {}
> >
> > and replaced with this:
> >
> > Statement st = conn.createStatement();
> > ResultSet rs = st.executeQuery("select username
> from test");
> > rs.next();
> > System.out.println(rs.getString(1));
> > rs.close();
> > st.close();
> > try {
> > Thread.sleep(2000);
> > }
> > catch (Exception ee) {}
> >
> > So when I run this new test and I connect to the test.gdb (I only
> > connect, I do not issue any sql command) then the java test hangs
> > up. It stops, but I don't know where. I've attached the log file,
> > the jave test ran three iterations, so it read the first record
> > three times.
>
> Most likely this is a deadlock. I had similar problems in my code,
> and the only thing that I needed was to set the transaction isolation
> to TRANSACTION_READ_COMMITED. Current default transaction isolation
> is TRANSACTION_REPEATABLE_READ.
>
> > It hangs up at a op_response according to the log, but I can not
> > interpret it.
>
> Same was in my case. Look for a deadlock.
>
> > Roman, I you tell me what would be required on a linux box for
> > debugging, probably I could give an account. (although that linux
> > box is not mine, but I will try everything to solve this)
>
> No, I meant that I'm not able to do this on the weekend, since the
> only computer here I have is my laptop running Win2k. I will try to
> test it at work next week.
>
> I will look into the code.
>
> Best regards,
> Roman
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 9
> Date: Sat, 13 Apr 2002 12:21:40 +0200
> From: Marczisovszky Daniel <marczi@...>
> Subject: other mailing lists
>
> Hi,
>
> I've tested this new java with close() calls, and it works perfectly
> on Windows. I guess it is a bug of Interbase/Firebird on linux unless
> the driver contains some platform-specific thing, I don't know.
>
> What other mailing list would you suggest to contact developers of
> Firebird/Interbase?
>
> Best wishes,
> Daniel
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 10
> Date: Sat, 13 Apr 2002 12:25:25 +0200
> From: Marczisovszky Daniel <marczi@...>
> Subject: Re: Re: problems on linux...
>
> >> Well, while I was playing with it, I found a more serious issue:
> >>
> >> I've added close statements to my code, which is absolutely correct
> >> according to the API.
> >>
> >> The original code was this
> >>
> >>���������������� Statement st = conn.createStatement();
> >>���������������� ResultSet rs = st.executeQuery("select username
> r> from test");
> >>���������������� rs.next();
> >>���������������� System.out.println(rs.getString(1));
> >>���������������� try {
> >>������������������ Thread.sleep(2000);
> >>���������������� }
> >>���������������� catch (Exception ee) {}
> >>
> >> and replaced with this:
> >>����������������
> >>���������������� Statement st = conn.createStatement();
> >>���������������� ResultSet rs = st.executeQuery("select username
> r> from test");
> >>���������������� rs.next();
> >>���������������� System.out.println(rs.getString(1));
> >>���������������� rs.close();
> >>���������������� st.close();
> >>���������������� try {
> >>������������������ Thread.sleep(2000);
> >>���������������� }
> >>���������������� catch (Exception ee) {}
> >>
> >> So when I run this new test and I connect to the test.gdb (I only
> >> connect, I do not issue any sql command) then the java test hangs
> >> up. It stops, but I don't know where. I've attached the log file,
> >> the jave test ran three iterations, so it read the first record
> >> three times.
>
> r> Most likely this is a deadlock. I had similar problems in my code,
> r> and the only thing that I needed was to set the transaction isolation
> r> to TRANSACTION_READ_COMMITED. Current default transaction isolation
> r> is TRANSACTION_REPEATABLE_READ.
>
> Actually I don't much about difference between these, but it seems
> soon I'll read as much as I can about it.
>
> >> It hangs up at a op_response according to the log, but I can not
> >> interpret it.
>
> r> Same was in my case. Look for a deadlock.
>
> Fine, but why? I understand if I update from isql at java at the same
> time. But the java is reading only and in isql I do *nothing*, I just
> typed "connect /opt/interbase/test.gdb;".
>
> Moreover it works fine on Windows.
>
> Daniel
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 11
> Date: Sat, 13 Apr 2002 10:29:13 -0000
> From: "rrokytskyy" <rrokytskyy@...>
> Subject: Re: Result Set not returning all rows
>
> > The test inserts four rows into a table. The third row contains a
> > copyright symbol. When I select * only two rows are returned and
> > no exceptions are thrown.
> >
> > In my larger program - I get gds synchronzation exceptions when I
> > try to close the resultset and statements. I do not get these
> > exceptions in the test case - but I am able to recreate the problem
> > where not all rows are returned.
>
> Confirmed. This happens when you don't specify the lc_ctype and let
> the driver select one. If you do specify the NONE, it works ok. I
> will make more testing to find out what charset causes the problem.
>
> Also we have to check why request sync. exception happens and
> not "cannot transliterate...".
>
> Best regards,
> Roman Rokytskyy
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 12
> Date: Sat, 13 Apr 2002 12:43:05 +0200
> From: Marczisovszky Daniel <marczi@...>
> Subject: Re: Re: problems on linux...
>
> r> Most likely this is a deadlock. I had similar problems in my code,
> r> and the only thing that I needed was to set the transaction isolation
> r> to TRANSACTION_READ_COMMITED. Current default transaction isolation
> r> is TRANSACTION_REPEATABLE_READ.
>
> Sorry, same happens with READ_COMMITTED, it hangs again... :(
>
> daniel
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 13
> Date: Sat, 13 Apr 2002 10:49:22 -0000
> From: "rrokytskyy" <rrokytskyy@...>
> Subject: Re: problems on linux...
>
> > Sorry, same happens with READ_COMMITTED, it hangs again... :(
>
> I will try the code. BTW, my deadlock happened on Windows too.
>
> Regards,
> Roman
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 14
> Date: Sat, 13 Apr 2002 12:56:00 +0200
> From: Marczisovszky Daniel <marczi@...>
> Subject: Re: Re: problems on linux...
>
> >> Sorry, same happens with READ_COMMITTED, it hangs again... :(
>
> r> I will try the code. BTW, my deadlock happened on Windows too.
>
> Well, I'm using Firebird 1.0. Should this deadlock occur? Does it have
> any reason, or we can assume that this is an absolutely abnormal
> behaviour?
>
> Now I go and try IB 6.5 evaluation version...
>
> daniel
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 15
> Date: Sat, 13 Apr 2002 16:04:18 +0200
> From: Marczisovszky Daniel <marczi@...>
> Subject: New experiences with the no-update and deadlock bug!
>
> Hi,
>
> I'm sure this must be a Firebird bug and this is a serious one. I've
> successfully installed Interbase 6.5 Trial version (the Borland guys
> released it with a broken install script :( grrr... )
>
> With IB6.5 and the new type 4 JDBC driver it works seamless. Are you
> agree that this is a really serious bug? If so, to whom should we send
> this? I looked at the bug database, but I'm not sure that anybody is
> reading that.
>
> best wishes,
> daniel
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 16
> Date: Sat, 13 Apr 2002 15:04:15 -0000
> From: "rrokytskyy" <rrokytskyy@...>
> Subject: Re: New experiences with the no-update and deadlock bug!
>
> > I'm sure this must be a Firebird bug and this is a serious one. I've
> > successfully installed Interbase 6.5 Trial version (the Borland guys
> > released it with a broken install script :( grrr... )
> >
> > With IB6.5 and the new type 4 JDBC driver it works seamless. Are you
> > agree that this is a really serious bug? If so, to whom should we
> > send this? I looked at the bug database, but I'm not sure that
> > anybody is reading that.
>
> If you are sure this is a bug, report it to the bug database. They do
> read the bug submissions. Alternatively, you can post to firebird-
> devel list directly. Also, it would be great if you can create a test
> case or put a detailed instructions what to do, since you have to
> execute some operations in different environments.
>
> This might be a bug, might not. I agree that such things should never
> happen, but if this is because the bug in the code or
> misconfiguration I cannot tell.
>
> I will try to check this behaviour, and if it is present, I will make
> a report in fb-devel list. However that might take some time.
>
> Best regards,
> Roman Rokytskyy
>
>
>
> ________________________________________________________________________
> ________________________________________________________________________
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/