[Persistence, JBoss/CMP, Hibernate, Database] - Two persistence units in one EJB3 App
by konstantin.ermakov
Hi!
I have two persistence units in my application - one is Oracle and one in HSQL. For the Oracle datasource all the tables are already created, so I use the mapping in my Entity beans. In Hypersonic DB I want to store some additional information, But as it is "In-Memory" I am using the configuration property hibernate.hbm2ddl.auto value="create-drop".
The idea is to use the oracle database to store the data and HSQL DB to store some runtime data, so I have the tables A,B,C in Oracle, and table D in HSQL.
And, all the entity beans that are configured for the Oracle database are immediately created in the HSQL database as well.
Are there any possibilities to configure the persistence unit the way, that only table D is generated?
Thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968579#3968579
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968579
18 years, 5 months
[JBoss jBPM] - JOIN - strange behaviour?
by smecherutza
In the following schema if transition A1:j1 entered in j1 and B1:j1 entered in j1, normally the C state should be reached automatically, but join state saying that is waitting for concurent transition from the B2 branch.Is this a normal behaviour? If i send signal for B2 branch before A1 and B1 everythings works fine. Please advise.
.........Start State
...............|
.......... Fork: f1
......./.................\
State:A...............State:B
....|...........................|
State:A1................Fork:f2
....|........................./.......\
....|................State:B1....State:B2
....|.................../...................|
.....\................/..................../
.......\............/..................../
..........Join:j1................ .../
..............|..................... ./
.............State:C............/
....................\............./
.......................Join:j2
..........................|
.......................End State
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968578#3968578
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968578
18 years, 5 months
[JBoss Seam] - Re: Calling a @CreateProcess method
by dgallego
This is the bean invoked within the transition in the pageflow. The method "isMessageSent" is used to redirect (evaluate decision in pageflow) to different webpages if the message has been successfully sent.
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.*;
| import org.jboss.seam.core.Actor;
| import org.jboss.seam.InterceptionType;
|
| @Name("contactAction")
| @Scope(ScopeType.EVENT)
| @Intercept(InterceptionType.ALWAYS)
| @Transactional
| public class ContactAction
| {
| @In(create=true)
| private Actor actor;
| private String name;
| private String email;
| private String message;
|
| @Out(scope=ScopeType.BUSINESS_PROCESS)
| private int messageId;
|
| private boolean messageSent;
|
| @Create
| @Begin(join=true, pageflow="Contact")
| public void begin()
| {
| messageSent = false;
| }
| public void sendMessage()
| {
| System.out.println("Hibernate...");
|
| messageSent = true; // hibernate doesn't fail, we suppose in the example....
|
| if (messageSent) startProcessDefinition();
|
| }
| @CreateProcess(definition="MessageContact")
| public void startProcessDefinition()
| {
| System.out.println("Creating process instance");
| // If this method is invoked from a button, perfect. But I want to create a process instance if the message is successfully sent (in sendMessage().
| }
| public boolean isMessageSent()
| {
| return messageSent;
| }
| public void doAction()
| {
| System.out.println("doAction!!");
| }
| public String getDescription()
| {
| return "Nuevo Mensaje";
| }
| @Destroy
| public void destroy()
| {
| System.out.println("Destroy");
| }
|
| public String getName() { return name; }
| public void setName(String name) { this.name = name; }
| public String getEmail() { return email; }
| public void setEmail(String email) { this.email = email; }
| public String getMessage() { return message; }
| public void setMessage(String message) { this.message = message; }
| }
|
A solution could be:
Add @CreateProcess to sendMessage() method, but I don't want a process instance to be created when the user sends a message.
I want to create the process instance when the message is successfully sent, i mean, I want to decide its creation.
Thanks for the replies.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968571#3968571
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968571
18 years, 5 months
[JBoss Seam] - Re: when and how does the seam create tables in the databas
by bfo81
In a Seam project (or maybe for kinds of EJB projects using Hibernate?) the database is created during server start (plus import.sql gets imported). This is an important difference to e.g. AppFuse (Spring + Hibernate), where the database gets created by an ant task which you have to call explicetly (btw. this is the better solution in my opinion... but you can argue about that *g*).
The line texan made bold is an important one. There are two values (as far as I know), and I experienced the following behaviour:
create-drop: The database is recreated every time your server starts. If there is already a database it gets dropped before, so all your data entries vanish.
update: The database is only created once, and your data "survives" server restarts. But if you change your entities by adding new fields the new fields get created in the database, too (upon server restart, remember ;)). If you delete entity bean fields the fields in the database remain. And if you change fields (e.g. from type Long to String, or from @ManyToOne to @ManyToMany) you will run into trouble, so you better do not do this ;).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968570#3968570
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968570
18 years, 5 months