AW: duplicate ID exception in cluster

2006-12-06 Thread Thoralf Rickert
It's a little bit off-topic but have a look at How to set up a load-balanced 
MySQL cluster (http://www.howtoforge.com/loadbalanced_mysql_cluster_debian). 
If you use a load-balancing server in front of the mysql cluster you don't have 
to change your application. The HowTo uses UltraMonkey to wrap the cluster 
behind a virtual IP that you have to use in your application. It works fine.

 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Im Auftrag von Will Glass-Husain
 Gesendet: Dienstag, 5. Dezember 2006 23:43
 An: Apache Torque Users List; [EMAIL PROTECTED]
 Betreff: Re: duplicate ID exception in cluster
 
 
 Hi Henning!
 
 It's a real (Tomcat) cluster.  Two instances of Tomcat 
 talking to a single database.  (no database replication).  I 
 use Apache/mod_jk to split requests (based on session) 
 between the two Tomcats.  Allows me to run high number of 
 users with a memory-heavy application.
 
 Thought briefly about database replication but since this is 
 write-heavy application it didn't seem to make sense.
 
 thanks,
 WILL
 
 On 12/5/06, Henning P. Schmiedehausen [EMAIL PROTECTED] wrote:
  Will Glass-Husain [EMAIL PROTECTED] writes:
 
  Hi,
 
  I just set up a new 2 server cluster with two instances of Tomcat 
  both reading/writing from a single database.  I'm using 
 Torque 3.0, 
  the default ID Broker and MySQL 5. (InnoDB)
 
  Real cluster or just master/slave (or master/master with only one 
  master active at a time)? The latter is just replication, 
 not a real 
  cluster.
 
  My problem... Under heavy load, I notice that most write 
 requests on 
  one of the servers fails with a duplicate ID error.  
 Typically, each 
  page request that fails does 10-20 insert statements.
 
  Any tips as to how I might make this cluster work with 
 simultaneous 
  writes?
 
  a) in a master/master config, you can not write to both 
 masters at the
 same time. End of story. I had a summer project where we tested
 exactly that *very* extensively. It does not work. No 
 matter what you
 google on the internet or what mysql.com wants to tell 
 you. You will
 get the described error sooner or later. If you want to have
 master/master with failover, that is fine. Two active 
 masters not.
 
  b) you probably run into the AUTO_INCREMENT problem. Make 
 sure that you
 have 5.0.20 at least. See 
 http://dev.mysql.com/doc/refman/5.0/en/replication-features.html
 for some docs.
 
 
  Best regards
  Henning
 
  --
  Henning P. Schmiedehausen  -- [EMAIL PROTECTED] | J2EE, Linux,
  91054 Buckenhof, Germany   -- +49 9131 506540 | Apache person
  Open Source Consulting, Development, Design | Velocity - Turbine guy
 
Save the cheerleader. Save the world.
 
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 Forio Business Simulations
 
 Will Glass-Husain
 [EMAIL PROTECTED]
 www.forio.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



maven torque failed

2006-12-06 Thread Aljosa Mohorovic

this is maven-torque tutorial/step 3,  when i type maven torque i get
this errror:




C:\Documents and Settings\Administrator\Desktop\testmaven torque
__  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2


BUILD FAILED
File.. C:\Documents and Settings\Administrator\.maven\cache\maven-torque-plu
gin-3.3-RC1\plugin.jelly
Element... taskdef
Line.. 115
Column 63
taskdef class org.apache.torque.task.TorqueDataModelTask cannot be found
Total time: 2 seconds
Finished at: Wed Dec 06 12:48:12 CET 2006


--
Aljosa Mohorovic

http://www.revolucija.hr
Ivana Lucica 5
1 Zagreb, Croatia

+385 (0)1 616 8414

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: duplicate ID exception in cluster

2006-12-06 Thread Henning Schmiedehausen
Ah, so it is an application cluster, not a db cluster (sorry, didn't saw
that in your first mail). 

You get this behaviour when the two nodes refresh their Id Broker from
the DB. Try

torque.idbroker.cleverquantity=false
torque.idbroker.prefetch=false

Better yet, don't use the Id broker but use an AUTO_INCREMENT column.

Best regards
Henning



On Tue, 2006-12-05 at 14:42 -0800, Will Glass-Husain wrote:
 Hi Henning!
 
 It's a real (Tomcat) cluster.  Two instances of Tomcat talking to a
 single database.  (no database replication).  I use Apache/mod_jk to
 split requests (based on session) between the two Tomcats.  Allows me
 to run high number of users with a memory-heavy application.
 
 Thought briefly about database replication but since this is
 write-heavy application it didn't seem to make sense.
 
 thanks,
 WILL
 
 On 12/5/06, Henning P. Schmiedehausen [EMAIL PROTECTED] wrote:
  Will Glass-Husain [EMAIL PROTECTED] writes:
 
  Hi,
 
  I just set up a new 2 server cluster with two instances of Tomcat both
  reading/writing from a single database.  I'm using Torque 3.0, the
  default ID Broker and MySQL 5. (InnoDB)
 
  Real cluster or just master/slave (or master/master with only one master
  active at a time)? The latter is just replication, not a real cluster.
 
  My problem... Under heavy load, I notice that most write requests on
  one of the servers fails with a duplicate ID error.  Typically, each
  page request that fails does 10-20 insert statements.
 
  Any tips as to how I might make this cluster work with simultaneous writes?
 
  a) in a master/master config, you can not write to both masters at the
 same time. End of story. I had a summer project where we tested
 exactly that *very* extensively. It does not work. No matter what you
 google on the internet or what mysql.com wants to tell you. You will
 get the described error sooner or later. If you want to have
 master/master with failover, that is fine. Two active masters not.
 
  b) you probably run into the AUTO_INCREMENT problem. Make sure that you
 have 5.0.20 at least. See 
  http://dev.mysql.com/doc/refman/5.0/en/replication-features.html
 for some docs.
 
 
  Best regards
  Henning
 
  --
  Henning P. Schmiedehausen  -- [EMAIL PROTECTED] | J2EE, Linux,
  91054 Buckenhof, Germany   -- +49 9131 506540 | Apache person
  Open Source Consulting, Development, Design | Velocity - Turbine guy
 
Save the cheerleader. Save the world.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
-- 
Henning P. Schmiedehausen  -- [EMAIL PROTECTED] | J2EE, Linux,
91054 Buckenhof, Germany   -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy

  Save the cheerleader. Save the world.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: duplicate ID exception in cluster

2006-12-06 Thread Will Glass-Husain

Converted to AUTO_INCREMENT, I'm much happier.  Also solves the
problem of restarting Tomcat and suddenly having the db id's be out of
sync with ID_TABLE.  Always hated the ID Broker :-)

WILL

On 12/6/06, Henning Schmiedehausen [EMAIL PROTECTED] wrote:

Ah, so it is an application cluster, not a db cluster (sorry, didn't saw
that in your first mail).

You get this behaviour when the two nodes refresh their Id Broker from
the DB. Try

torque.idbroker.cleverquantity=false
torque.idbroker.prefetch=false

Better yet, don't use the Id broker but use an AUTO_INCREMENT column.

Best regards
Henning



On Tue, 2006-12-05 at 14:42 -0800, Will Glass-Husain wrote:
 Hi Henning!

 It's a real (Tomcat) cluster.  Two instances of Tomcat talking to a
 single database.  (no database replication).  I use Apache/mod_jk to
 split requests (based on session) between the two Tomcats.  Allows me
 to run high number of users with a memory-heavy application.

 Thought briefly about database replication but since this is
 write-heavy application it didn't seem to make sense.

 thanks,
 WILL

 On 12/5/06, Henning P. Schmiedehausen [EMAIL PROTECTED] wrote:
  Will Glass-Husain [EMAIL PROTECTED] writes:
 
  Hi,
 
  I just set up a new 2 server cluster with two instances of Tomcat both
  reading/writing from a single database.  I'm using Torque 3.0, the
  default ID Broker and MySQL 5. (InnoDB)
 
  Real cluster or just master/slave (or master/master with only one master
  active at a time)? The latter is just replication, not a real cluster.
 
  My problem... Under heavy load, I notice that most write requests on
  one of the servers fails with a duplicate ID error.  Typically, each
  page request that fails does 10-20 insert statements.
 
  Any tips as to how I might make this cluster work with simultaneous writes?
 
  a) in a master/master config, you can not write to both masters at the
 same time. End of story. I had a summer project where we tested
 exactly that *very* extensively. It does not work. No matter what you
 google on the internet or what mysql.com wants to tell you. You will
 get the described error sooner or later. If you want to have
 master/master with failover, that is fine. Two active masters not.
 
  b) you probably run into the AUTO_INCREMENT problem. Make sure that you
 have 5.0.20 at least. See 
http://dev.mysql.com/doc/refman/5.0/en/replication-features.html
 for some docs.
 
 
  Best regards
  Henning
 
  --
  Henning P. Schmiedehausen  -- [EMAIL PROTECTED] | J2EE, Linux,
  91054 Buckenhof, Germany   -- +49 9131 506540 | Apache person
  Open Source Consulting, Development, Design | Velocity - Turbine guy
 
Save the cheerleader. Save the world.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


--
Henning P. Schmiedehausen  -- [EMAIL PROTECTED] | J2EE, Linux,
91054 Buckenhof, Germany   -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy

  Save the cheerleader. Save the world.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Forio Business Simulations

Will Glass-Husain
[EMAIL PROTECTED]
www.forio.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: maven torque failed

2006-12-06 Thread Greg Monroe
Another user reported a similar problem that may be related.  It 
looks like a jar for a product Torque uses (Velocity) was 
dropped from the dependencies by mistake. 

Try this for a quick fix:

Jump ahead to the next section in Step 3 of the tutorial 
(Creating the database and tables).  Follow that to 
create your project.xml file.

Then add the following dependany element in the dependancies
XML section.

dependency
  artifactIdlogkit/artifactId
  groupIdlogkit/groupId
  version1.0.1/version
 
urlhttp://avalon.apache.org/products/runtime/system/logging//url
  properties
dist.bundletrue/dist.bundle
  /properties
/dependency

This should add the missing jar to the maven classpath and 
hopefully fix your maven torque problem.

Alternatively, if you want to use ant, just get the logkit-1.0.1.jar
from the avalon.apache.org site and put it in the generator lib
directory.

Let us know if this fixes it.


 -Original Message-
 From: Aljosa Mohorovic [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, December 06, 2006 7:03 AM
 To: Apache Torque Users List
 Subject: maven torque failed
 
 this is maven-torque tutorial/step 3,  when i type maven 
 torque i get this errror:
 
 
 C:\Documents and Settings\Administrator\Desktop\testmaven 
 torque  __  __
 |  \/  |__ _Apache__ ___
 | |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
 |_|  |_\__,_|\_/\___|_||_|  v. 1.0.2
 
 
 BUILD FAILED
 File.. C:\Documents and 
 Settings\Administrator\.maven\cache\maven-torque-plu
 gin-3.3-RC1\plugin.jelly
 Element... taskdef
 Line.. 115
 Column 63
 taskdef class org.apache.torque.task.TorqueDataModelTask 
 cannot be found Total time: 2 seconds Finished at: Wed Dec 06 
 12:48:12 CET 2006 
 
 --
 Aljosa Mohorovic
 
 http://www.revolucija.hr
 Ivana Lucica 5
 1 Zagreb, Croatia
 
 +385 (0)1 616 8414
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are 
confidential communication or may otherwise be privileged or confidential and 
are intended solely for the individual or entity to whom they are addressed.  
If you are not the intended recipient you may not rely on the contents of this 
email or any attachments, and we ask that you  please not read, copy or 
retransmit this communication, but reply to the sender and destroy the email, 
its contents, and all copies thereof immediately.  Any unauthorized 
dissemination, distribution or copying of this communication is strictly 
prohibited.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]