[JBoss-user] [Persistence,JBoss/CMP, Hibernate, Database] - Schema update creates sequence in wrong schema

2006-04-25 Thread pieterjan
Hi all,

Has anyone ever experienced this?

I used to hardcode the schema name in my entity beans, but now I use a static 
import of the schema name 
(thinking that this would make it easy to switch between a live version and a 
debug version of the database-model)

But when I set DB_SCHEMA_REQFORM from its original value "reqform" to 
"reqform_debug" and redeploy the project, the sequences are still created in 
"reqform". Why is that, I wonder?

import static be.barc.reqform.server.system.DB.DB_SCHEMA_REQFORM;
  | 
  | @Entity(access = AccessType.FIELD)
  | @Table(name = "c_layout_fonts", 
  | schema = DB_SCHEMA_REQFORM
  | )
  | @SequenceGenerator(name = "LayoutFontBeanSequence", sequenceName = 
"s_layout_fonts")
  | public class LayoutFontBean implements Serializable {
  | 
  | @Id(generate = GeneratorType.SEQUENCE, generator = 
"LayoutFontBeanSequence")
  | private long id;
  | 
  | ...
  | 
  | }

cheers

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3939270#3939270

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3939270


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Beginners Corner] - Re: ClassCastException for remote acccess of entity bean

2006-04-10 Thread pieterjan
Can an entity bean have a local and remote interface or doest that only apply 
to session beans?

Anyway, I'm accessing the entity bean through an SLSB (using the dao-pattern 
found in Hibernate in action). A call to findAll().size() will return the 
correct amount of records in my table. But the call findById() throws the 
ClassCastException when I try to assign the returnvalue to an object of the 
entity bean's class.

Here is how my packages roughly look like:

One.ear:
- entity bean (to oracle, no interface)
- stateless session bean  (dao implementation and interface)

Two.ear:
- stateless session bean (a facade that calls the dao from one.ear causing the 
exception at the cast)

So far no luck using PortableRemoteObject.


Thanks for the help Kurt ... but keep it coming ;-)
Or any idea where I can find an example where multiple ear files are deployed 
where this kind of remoting is used?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3936265#3936265

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3936265


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Beginners Corner] - ClassCastException for remote acccess of entity bean

2006-04-07 Thread pieterjan
Hi,

I'm working on JBoss 4.0.3SP1 and I'm trying to access an entity bean deployed 
in one.ear one from two.ear.

I've been messing around a bit because I can't get it to work. I've deployed 
both ears, and have put a jar-file containing all classes from one.ear in the 
lib directory of the server. (otherwise two.ear didn't find the classes it 
needed)

But now, when I try to get the entity bean from one.ear and use it in two.ear I 
get a ClassCastException.

The strange thing is when I do a findAll() of the entity beans in two.ear, and 
show the number of entities that are found, the correct number is shown. But 
from the moment I actually want to use the entity object, the error is thrown. 

Anyone have an idea how I can get this thing to run? 
And how I can deploy my two.ear so that it does find all classes it needs and 
without putting the jar-file in the lib folder?

tnx

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3935808#3935808

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3935808


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Persistence,JBoss/CMP, Hibernate, Database] - Index annotation

2006-03-16 Thread pieterjan
I was wondering if is is possible to put an
index annotation on a column or joincolumn of an entity bean, 
so that the JBoss server would automatically create the indexes
together with the rest of the schema.

I found some links about XDoclets dbindex, but I'm not sure if this is helpfull.



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3930676#3930676

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3930676


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Beginners Corner] - Re: Stop automatic persist of parents children?

2006-01-06 Thread pieterjan
Solved it!

Apparently it had nothing to do with read-only beans but with the way JBoss 
4.0.2 checks for dirty entity beans. 
Upgrading to 4.0.3SP1 solved the problem.

BTW, the performance increase is HUGE. 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3916038#3916038

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3916038


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Beginners Corner] - Re: Where can I find the JBOss examples mentioned in the adm

2005-12-28 Thread pieterjan

On the JBoss website:

1. Go to Documentation 
2. Select the documentation of the JBoss Application Server
3. Select the source of JBoss Application Server Guide

That's it

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3914557#3914557

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3914557


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Beginners Corner] - Re: Stop automatic persist of parents children?

2005-12-28 Thread pieterjan
I found out that the simple parent-child example I gave, does not produce the 
selection statements I was talking about. Instead a parent-child-grandchild 
relation does produce the problem.


I used the following classes to test (the getters and setters are removed here) 
:


  | 
  | // Parent
  | 
  | @Entity(access = AccessType.FIELD)
  | @Table(name="t_tests", schema="grid")
  | @SequenceGenerator(name="TestBeanSequence", sequenceName="grid.s_tests")
  | public class TestBean implements Serializable {
  | 
  | @Id(generate=GeneratorType.SEQUENCE, generator="TestBeanSequence")
  | private Integer id;
  | 
  | @Column(length=255)
  | private String  someText;
  | 
  | @Basic(temporalType = TemporalType.TIMESTAMP)
  | private DatesomeDate;
  | 
  | private Boolean someBoolean;
  | 
  | @OneToMany(targetEntity=TestChildBean.class, 
  | mappedBy="test", 
  | cascade=CascadeType.ALL,
  | fetch=FetchType.LAZY)
  | private List testChildren;
  | }
  | 
  | 
  | // Child
  | 
  | @Entity(access = AccessType.FIELD)
  | @Table(name="t_testchilds", schema="grid")
  | @SequenceGenerator(name="TestChildBeanSequence", 
sequenceName="grid.s_testchilds")
  | public class TestChildBean {
  | 
  | @Id(generate=GeneratorType.SEQUENCE, generator="TestChildBeanSequence")
  | private Integer id;
  | 
  | @Column(length=20, nullable=false)
  | private String  name;
  | 
  | @ManyToOne(targetEntity=TestBean.class, fetch=FetchType.LAZY)
  | @JoinColumn(name="test_id", nullable = false)
  | private TestBean test;
  | 
  | @OneToMany(targetEntity=TestGrandChildBean.class, 
  | mappedBy="testChild", 
  | cascade=CascadeType.ALL,
  | fetch=FetchType.LAZY)
  | private List testGrandChildren; 
  | }
  | 
  | // Grandchild
  | 
  | @Entity(access = AccessType.FIELD)
  | @Table(name="t_testgrandchilds", schema="grid")
  | @SequenceGenerator(name="TestGrandChildBeanSequence", 
sequenceName="grid.s_testgrandchilds")
  | public class TestGrandChildBean {
  | 
  | @Id(generate=GeneratorType.SEQUENCE, 
generator="TestGrandChildBeanSequence")
  | private Integer id;
  | 
  | @Column(length=20, nullable=false)
  | private String  name;
  | 
  | @ManyToOne(targetEntity=TestChildBean.class, fetch=FetchType.LAZY)
  | @JoinColumn(name="testchild_id", nullable = false)
  | private TestChildBean testChild;
  | }
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3914539#3914539

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3914539


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Beginners Corner] - Re: Stop automatic persist of parents children?

2005-12-27 Thread pieterjan

Interesting.

I found the following link 
http://e-docs.bea.com/workshop/docs81/doc/en/core/index.html at the bea 
website. 
Where in the section 'Developing Enterprise JavaBean' > 'Developing Entity 
Beans' > 'Accelerating Entity Bean Data Access' they give a few pointers on how 
to make entity beans that are read only.

I wonder if I could do the same in JBoss and if this would prevent the server 
from trying to update each entity bean?



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3914401#3914401

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3914401


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Beginners Corner] - Stop automatic persist of parents children?

2005-12-23 Thread pieterjan
Hi,

I came upon this problem when looking at the hibernate queries that JBoss AS 
executes for bi-directional relations (i.e. parent-child).

The problem is that when a method of a session bean is called and in that 
method a parent entity bean is used, then after finishing the method the server 
will execute a ton of select statements for the children.
My guess, to merge or update the children.

But seeing as I only access properties, I would like a way to stop this 
automatic update of the children.

If anyone knows a way, I'm all ears.


The annotations for parent and children I use now look as follows:



  | 
  | // in the parent entity bean
  | 
  | @OneToMany(targetEntity=ChildBean.class, 
  | mappedBy="parent", 
  | cascade=CascadeType.ALL,
  | fetch=FetchType.LAZY)
  | private List children;
  | 
  | 
  | // int the child entity bean
  | 
  | @ManyToOne(targetEntity=ParentBean.class, fetch=FetchType.LAZY)
  | @JoinColumn(name="parent_id", nullable = false)
  | private ParentBean parent;
  | 
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3914186#3914186

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3914186


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JCA/JBoss] - Transaction does not rollback

2005-12-20 Thread pieterjan
I'm having problems using transactions on JBoss 4.0.2. 
When I throw an error in some method of a SLSB with CMP that is part of a 
transaction, then the changes made inside the method prior to the exception are 
persisted.
So it seems as though the container persists the changes from the moment I make 
them and not after finishing the method:

An example:


  | 
  | @Stateless
  | @Remote(GridSession.class)
  | @TransactionManagement(TransactionManagementType.CONTAINER) 
  | public class GridSessionBean implements GridSession, Serializable {
  | 
  | @PersistenceContext(unitName="gridManager")
  | private EntityManager em;
  | 
  | private boolean standalone = false;
  | 
  | private DAOFactory getDAOFactory() {
  | DAOFactory factory;
  | if (standalone) {
  | factory = DAOFactory.HIBERNATE_PERSISTENCE;
  | } else {
  | factory = DAOFactory.EJB3_PERSISTENCE;
  | }
  | return factory;
  | }
  | 
  | @TransactionAttribute(TransactionAttributeType.REQUIRED) 
  | public void testTransaction() throws Exception {
  | 
  | // get dao
  | DAOFactory factory = getDAOFactory();
  | TestDAO testDao = factory.getTestDAO();
  | testDao.setEm(em);
  | 
  | // get the testbean with id = 1
  | TestBean testBean = testDao.findById(1, false);
  | 
  | testBean.setSomeText("this text may not be persisted");
  | 
  | // throw an exception
  | if (true) throw new Exception("Make transaction rollback");
  | 
  | testBean.setSomeDate(new Date());
  | }
  | 

In this example the table grid.t_tests contains one tuple with id = 1 and some 
defaults for the other columns.
When I call this method on a client and look at the database after the 
exception was thrown, the string "this text may not be persisted" was persisted.


Any help on getting this transaction to rollback would be appreciated.


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3913592#3913592

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3913592


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Does TransactionAttributeType.NOT_SUPPORTED work?

2005-12-20 Thread pieterjan
Have you tried using @FlushMode(FlushModeType.NEVER)
instead ?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3913554#3913554

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3913554


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user