Re: [JBoss-user] Force create of table after manual drop?
Oops, the change is only in 2.5. You can change 2.2 or 2.4 yourself, I originally qrote it for 2.2 david jencks On 2001.07.28 18:48:12 -0400 David Jencks wrote: > Hmm, I'm interested to see that firebird/interbase is not the only rdbms > with archaic syntax. > > In 2.4 (since june 16) you can specify not null constraints on your > columns > like this (per column) > > false > > Jaws will then create your tables with the not null columns so you can > use > primary keys. > > Code in CMPFieldMetaData and JDBCInitCommand. > > david jencks > > On 2001.07.28 14:40:57 -0400 David M. Karr wrote: > > xxx> "David" == David M Karr <[EMAIL PROTECTED]> writes: > > > > David> In JBoss 2.2.2, using MySQL, I had a sample application, and > > it had created a > > David> table. I manually dropped the table, now I'm trying to > figure > > out how to get > > David> JBoss to figure out it needs to recreate the table. I've > > tried various things, > > David> like deleting the deployed jar from the "deploy" directory, > > and the unjarred > > David> directory in the "tmp" directory. I've redeployed the jar, > > and JBoss seems to > > David> do it without complaining, but it still refuses to create > the > > table. > > > > (I had to send this twice, because apparently the list manager rejects > > notes > > which have the same sender and the same first line. I think I can > > understand > > why it does this (spam defense, perhaps?), but it makes it an annoyance > > when > > someone tries to respond to the same note with different information. > > Hopefully adding "xxx" to the first line will avoid this check. I > would > > assume > > spam generators could easily do the same thing automatically.) > > > > I was able to fix this, but I need to learn more about what I had to > > change. > > > > At one point, probably AFTER I had created the initial table, I had set > > the > > "pk-constraint" field in "standardjaws.xml" to "true". When I finally > > turned > > on SQL debugging (so I can see the statements), I noticed when it tried > > to > > create the table, it was creating a constraint with it. That reminded > me > > of > > that field. I just tried setting it back to "false" and restarting, > and > > it > > worked fine. I guess I have some reading to do. > > > > -- > > === > > David M. Karr ; Best Consulting > > [EMAIL PROTECTED] ; Java/Unix/XML/C++/X ; BrainBench CJ12P > (#12004) > > > > > > ___ > > JBoss-user mailing list > > [EMAIL PROTECTED] > > http://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-user > > ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Force create of table after manual drop?
Hmm, I'm interested to see that firebird/interbase is not the only rdbms with archaic syntax. In 2.4 (since june 16) you can specify not null constraints on your columns like this (per column) false Jaws will then create your tables with the not null columns so you can use primary keys. Code in CMPFieldMetaData and JDBCInitCommand. david jencks On 2001.07.28 14:40:57 -0400 David M. Karr wrote: > xxx> "David" == David M Karr <[EMAIL PROTECTED]> writes: > > David> In JBoss 2.2.2, using MySQL, I had a sample application, and > it had created a > David> table. I manually dropped the table, now I'm trying to figure > out how to get > David> JBoss to figure out it needs to recreate the table. I've > tried various things, > David> like deleting the deployed jar from the "deploy" directory, > and the unjarred > David> directory in the "tmp" directory. I've redeployed the jar, > and JBoss seems to > David> do it without complaining, but it still refuses to create the > table. > > (I had to send this twice, because apparently the list manager rejects > notes > which have the same sender and the same first line. I think I can > understand > why it does this (spam defense, perhaps?), but it makes it an annoyance > when > someone tries to respond to the same note with different information. > Hopefully adding "xxx" to the first line will avoid this check. I would > assume > spam generators could easily do the same thing automatically.) > > I was able to fix this, but I need to learn more about what I had to > change. > > At one point, probably AFTER I had created the initial table, I had set > the > "pk-constraint" field in "standardjaws.xml" to "true". When I finally > turned > on SQL debugging (so I can see the statements), I noticed when it tried > to > create the table, it was creating a constraint with it. That reminded me > of > that field. I just tried setting it back to "false" and restarting, and > it > worked fine. I guess I have some reading to do. > > -- > === > David M. Karr ; Best Consulting > [EMAIL PROTECTED] ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004) > > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-user > > ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Force create of table after manual drop?
xxx> "David" == David M Karr <[EMAIL PROTECTED]> writes: David> In JBoss 2.2.2, using MySQL, I had a sample application, and it had created a David> table. I manually dropped the table, now I'm trying to figure out how to get David> JBoss to figure out it needs to recreate the table. I've tried various things, David> like deleting the deployed jar from the "deploy" directory, and the unjarred David> directory in the "tmp" directory. I've redeployed the jar, and JBoss seems to David> do it without complaining, but it still refuses to create the table. (I had to send this twice, because apparently the list manager rejects notes which have the same sender and the same first line. I think I can understand why it does this (spam defense, perhaps?), but it makes it an annoyance when someone tries to respond to the same note with different information. Hopefully adding "xxx" to the first line will avoid this check. I would assume spam generators could easily do the same thing automatically.) I was able to fix this, but I need to learn more about what I had to change. At one point, probably AFTER I had created the initial table, I had set the "pk-constraint" field in "standardjaws.xml" to "true". When I finally turned on SQL debugging (so I can see the statements), I noticed when it tried to create the table, it was creating a constraint with it. That reminded me of that field. I just tried setting it back to "false" and restarting, and it worked fine. I guess I have some reading to do. -- === David M. Karr ; Best Consulting [EMAIL PROTECTED] ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004) ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Force create of table after manual drop?
> "David" == David M Karr <[EMAIL PROTECTED]> writes: David> In JBoss 2.2.2, using MySQL, I had a sample application, and it had created a David> table. I manually dropped the table, now I'm trying to figure out how to get David> JBoss to figure out it needs to recreate the table. I've tried various things, David> like deleting the deployed jar from the "deploy" directory, and the unjarred David> directory in the "tmp" directory. I've redeployed the jar, and JBoss seems to David> do it without complaining, but it still refuses to create the table. I was able to fix this, but I need to learn more about what I had to change. At one point, probably AFTER I had created the initial table, I had set the "pk-constraint" field in "standardjaws.xml" to "true". When I finally turned on SQL debugging (so I can see the statements), I noticed when it tried to create the table, it was creating a constraint with it. That reminded me of that field. I just tried setting it back to "false" and restarting, and it worked fine. I guess I have some reading to do. -- === David M. Karr ; Best Consulting [EMAIL PROTECTED] ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004) ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Force create of table after manual drop?
On 27 Jul 2001 22:09:29 -0700, David M. Karr wrote: > > "David" == David M Karr <[EMAIL PROTECTED]> writes: > > David> In JBoss 2.2.2, using MySQL, I had a sample application, and it had >created a > David> table. I manually dropped the table, now I'm trying to figure out how to >get > David> JBoss to figure out it needs to recreate the table. I've tried various >things, > David> like deleting the deployed jar from the "deploy" directory, and the >unjarred > David> directory in the "tmp" directory. I've redeployed the jar, and JBoss >seems to > David> do it without complaining, but it still refuses to create the table. > > Ok, I have some more information. I checked the "server.log" file, and I saw > the following: > > [JAWS] java.sql.SQLException: General error: All parts of a PRIMARY KEY must be NOT >NULL; If you need NULL in a key, use UNIQUE instead > [JAWS]at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497) > [JAWS] ... > [JAWS] Could not create table CDBean: General error: All parts of a PRIMARY KEY must >be NOT NULL; If you need NULL in a key, use UNIQUE instead Hmmm, it's MySQL giving you that error. Something is not right with your Driver or with JAWS (probably your setup). Any idea what causes it to believe that the primary key is null all of a sudden? Are the typmappings etc... in jaws.xml correct? > However, I'm not sure when this occurred. I'm having trouble understanding how > the log file works. It seems to be created with a large number of nulls at the > beginning of the file, even when I delete it and restart JBoss. I haven't > noticed any option to timestamp log file entries. This is more of a log4j thingy. I don't know enough about that. -- Nicolai P Gubahttp://www.gnu.org http://www.frontwire.com mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] GSM: +44 (0)7909 960 751 DDI: +44 (0)20 7368 9708 ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Force create of table after manual drop?
> "David" == David M Karr <[EMAIL PROTECTED]> writes: David> In JBoss 2.2.2, using MySQL, I had a sample application, and it had created a David> table. I manually dropped the table, now I'm trying to figure out how to get David> JBoss to figure out it needs to recreate the table. I've tried various things, David> like deleting the deployed jar from the "deploy" directory, and the unjarred David> directory in the "tmp" directory. I've redeployed the jar, and JBoss seems to David> do it without complaining, but it still refuses to create the table. Ok, I have some more information. I checked the "server.log" file, and I saw the following: [JAWS] java.sql.SQLException: General error: All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead [JAWS] at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497) [JAWS] ... [JAWS] Could not create table CDBean: General error: All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead However, I'm not sure when this occurred. I'm having trouble understanding how the log file works. It seems to be created with a large number of nulls at the beginning of the file, even when I delete it and restart JBoss. I haven't noticed any option to timestamp log file entries. -- === David M. Karr ; Best Consulting [EMAIL PROTECTED] ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004) ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Force create of table after manual drop?
> "Nicolai" == Nicolai P Guba writes: Nicolai> On 26 Jul 2001 19:45:41 -0700, David M. Karr wrote: >> > "Nicolai" == Nicolai P Guba writes: >> My situation is less complicated than that. I just changed the default >> standardjaws.xml to use mySQL instead of Hypersonic, then I created my project. >> I didn't change any type mappings. When I deployed the jar initially, it >> worked fine. It created the table, and I was able to run methods to create >> rows, delete rows, list rows, etcetera. I then decided I wanted to try >> something absurd and drop the table. Now, I can't seem to convince it that the >> table needs to be recreated. Nicolai> I'm not sure it is a good idea manually manipulating a database where a Nicolai> EJB server is running on top of it... However, on tests I've dropped Nicolai> tables and databases many times and they were always re-created. Nicolai> Hm Yes, of course it's not a good idea. It was just an experiment. However, now I'm stuck. I can't figure out how to get the table re-created. -- === David M. Karr ; Best Consulting [EMAIL PROTECTED] ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004) ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Force create of table after manual drop?
On 26 Jul 2001 19:45:41 -0700, David M. Karr wrote: > > "Nicolai" == Nicolai P Guba writes: > My situation is less complicated than that. I just changed the default > standardjaws.xml to use mySQL instead of Hypersonic, then I created my project. > I didn't change any type mappings. When I deployed the jar initially, it > worked fine. It created the table, and I was able to run methods to create > rows, delete rows, list rows, etcetera. I then decided I wanted to try > something absurd and drop the table. Now, I can't seem to convince it that the > table needs to be recreated. I'm not sure it is a good idea manually manipulating a database where a EJB server is running on top of it... However, on tests I've dropped tables and databases many times and they were always re-created. Hm My real problem is with JAWS right now. I've done imports of recrords larger than 20k rows and suddenly JAWS couln't read the ResultSet any more. I am a bit perplexed and have ABSOLUTELY no clue what is going on. (See my JAWS problem posting). I am thinking going live in three weeks time. If I cannot get over this hurdle rather soon then I cannot use JBoss for deployment. I wish I had your problem :) -- Nicolai P Gubahttp://www.gnu.org http://www.frontwire.com CTO mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] GSM: +44 (0)7909 960 751 DDI: +44 (0)20 7368 9708 ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Force create of table after manual drop?
> "Nicolai" == Nicolai P Guba writes: Nicolai> On 25 Jul 2001 22:28:54 -0700, David M. Karr wrote: >> In JBoss 2.2.2, using MySQL, I had a sample application, and it had created a >> table. I manually dropped the table, now I'm trying to figure out how to get >> JBoss to figure out it needs to recreate the table. I've tried various things, >> like deleting the deployed jar from the "deploy" directory, and the unjarred >> directory in the "tmp" directory. I've redeployed the jar, and JBoss seems to >> do it without complaining, but it still refuses to create the table. Nicolai> I experienced the same problem. In my case the fault was that I changed Nicolai> from PostgreSQL to MySQL and the VARCHAR has been defined in PostgreSQL Nicolai> as VARCHAR(256) whereas MySQL expects a VARCHAR(255) as maximum Nicolai> acceptable value. Nicolai> Because the mapping was not right it couldn't create the tables (quite Nicolai> logical). Maybe you'd like to verify your mappings in your jaws.xml? My situation is less complicated than that. I just changed the default standardjaws.xml to use mySQL instead of Hypersonic, then I created my project. I didn't change any type mappings. When I deployed the jar initially, it worked fine. It created the table, and I was able to run methods to create rows, delete rows, list rows, etcetera. I then decided I wanted to try something absurd and drop the table. Now, I can't seem to convince it that the table needs to be recreated. -- === David M. Karr ; Best Consulting [EMAIL PROTECTED] ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004) ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Force create of table after manual drop?
> "Dragos" == Dragos Haiduc <[EMAIL PROTECTED]> writes: David> David M. Karr wrote: David> In JBoss 2.2.2, using MySQL, I had a sample application, and it had created a David> table. I manually dropped the table, now I'm trying to figure out how to get David> JBoss to figure out it needs to recreate the table. I've tried various things, David> like deleting the deployed jar from the "deploy" directory, and the unjarred David> directory in the "tmp" directory. I've redeployed the jar, and JBoss seems to David> do it without complaining, but it still refuses to create the table. Dragos> How does your jaws.xml deployment descriptor look like? Dragos> How about your standardjaws.xml? Following this is the beginning of my "standardjaws.xml". I didn't create a jaws.xml. -- java:/mySQLDS mySQL false true true true false 300 false true ... -- -- === David M. Karr ; Best Consulting [EMAIL PROTECTED] ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004) ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Force create of table after manual drop?
On 25 Jul 2001 22:28:54 -0700, David M. Karr wrote: > In JBoss 2.2.2, using MySQL, I had a sample application, and it had created a > table. I manually dropped the table, now I'm trying to figure out how to get > JBoss to figure out it needs to recreate the table. I've tried various things, > like deleting the deployed jar from the "deploy" directory, and the unjarred > directory in the "tmp" directory. I've redeployed the jar, and JBoss seems to > do it without complaining, but it still refuses to create the table. I experienced the same problem. In my case the fault was that I changed from PostgreSQL to MySQL and the VARCHAR has been defined in PostgreSQL as VARCHAR(256) whereas MySQL expects a VARCHAR(255) as maximum acceptable value. Because the mapping was not right it couldn't create the tables (quite logical). Maybe you'd like to verify your mappings in your jaws.xml? -- Nicolai P Gubahttp://www.gnu.org http://www.frontwire.com mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] GSM: +44 (0)7909 960 751 DDI: +44 (0)20 7368 9708 ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Force create of table after manual drop?
How does your jaws.xml deployment descriptor look like? How about your standardjaws.xml? David M. Karr wrote: > In JBoss 2.2.2, using MySQL, I had a sample application, and it had created a > table. I manually dropped the table, now I'm trying to figure out how to get > JBoss to figure out it needs to recreate the table. I've tried various things, > like deleting the deployed jar from the "deploy" directory, and the unjarred > directory in the "tmp" directory. I've redeployed the jar, and JBoss seems to > do it without complaining, but it still refuses to create the table. > ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user