[Persistence, JBoss/CMP, Hibernate, Database] - Re: Entities in clustered environment
by jochen.reinhardt
Hi,
I must admit, I am new to clustering with JBoss. But I am currently learning for an exam for MySQL cluster. That would be what you called an high end database cluster ;-). The cost is 0,00$ or whatever currency you prefer :-D
I guess having several databases is not feasable. There would be too much work to do for replacating between them. And as DB replication is usually done in an asynchronous way, you will never know when the second database applies the latest changes. As far as I know, replication is used for backup-purposes and cold standby. That means, you use the slave to do backups while the master is still running - stopping relplication during backup allows to make a consistent backup. In the second scenario, you change the application configuration to fall back to the replication slave when the master fails. This usually will cause loss of some data. As the updates happen asynchronously, there is no transaction support. I guess that can't be used for JBoss clustering.
Instead, using a clustered database is what I would recommend. In case of MySQL, you'll have some NDB nodes, storing and retrieving cluster data in main memory, and several MySQL server nodes for accessing the cluster via SQL. A typical setup would be having four NDB nodes, two MySQL nodes and at least one management node for setting up and monitoring the cluster. I think, in a JBoss Cluster made up of two nodes, you should be able to use the MySQL server nodes as datasources.
Your APP
/ \
AS1 <------> AS2
| |
MySQL1 MySQL2
| |
NDB1 <------> NDB2
| X |
NDB3 <------> NDB4
Your APP: your application with some kind of interface to the user / caller. You could also be able to add some kind of load balancing proxy on top of your setup.
AS: JBoss Application Server
MySQL: MySQL server node
NDB: MySQL cluster data node
This way the DB would not be your single point of failure, as it is HA by design. But as I said, I really do not have any idea about JBoss clustering, so it may be that I am wrong in some points. But from a DB point of view, this would be a recommended setup.
Best regards,
Jochen
PS: Clustering is very expensive, if you want to do it right. All componenent have to exist at leas twice. This is also true for your network equipment. E.g connecting all nodes using one switch will make the switch your single point of failure and so on...
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220100#4220100
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220100
17 years, 1 month
[EJB 3.0] - Re: many to many mapping problem
by jochen.reinhardt
The messages indicate, that you do not have your primary key set correctly. I think you have to do that manually. It's a bit tricky, as your primary key for skill level is a composition of two foreign keys. I think you have to correct that...
I solved the problem by adding @Column (in the primary key class) and @JoinColumn (for your releationships) and @AttributeOverride (for your embedded primary key) annotation. For the JoinColumn, I had to set insertable and updateable to false, as the columns will be generated by the primary key. Use the same names for the columns in your primary key class as for the JoinColumns. I guess hibernate will have created distinct columns for your primary key and your relationship definition, but that's not what you really wanted. Check your schema to see what hibernat actually does on database level!
Before saving your entities, be sure to set all fields of your bean. The primary key AND your relation fields - this feels like doing a little bit of work twice, but I think it turns out to be correct.
For your relationships, try to find the correct settings for cascading. E.g, when you remove a vendor, you will also want that all skill levels for that vendor be removed. When you remove a skill, you may want that all skill levels be removed. Either use cascading or do it manually in your code.
Good luck!
Jochen
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220099#4220099
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220099
17 years, 1 month
[Security & JAAS/JBoss] - two authorization/authenications mechanisms in one j2ee app
by adamzrk
Hi
I've got big problem. There is the system on which I do work, it uses NTLM to autheticate the user. There is special authenticator - the same like NtlmHttpFilter from Jcifs, but not a servlet - a special class (which is derived from AuthenticationBase from tomcat jars) packaged as jar together with login module, which I use in my app. Login module is used to authorise the user - retrieves roles from database.
When user enteres the app url in the browser it is automatically logged in when she/he is logged in the domain. But when not - the browser shows the window to log in.
I need in my app the second way to authenticate and authorise the user - login and password should be matched with these from db. I wrote a special jsp and servlet to do that. I also wrote loginModule to log user from db. But how can I do authorisation - so that user roles are retrieved correctly?
Application uses ejb3 and user principal must be in the sessioncontext.
Is that possible?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220098#4220098
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220098
17 years, 1 month