Re: Timestamp ignored

2008-06-30 Thread Julia O

Thank you, but i figure this out. I had @ID tag on multiple fields, so all
but the first @ID were being ignored. Its all working now. I dont know how
to remove this thread since it seems like i posted it in the wrong forum.
-- 
View this message in context: 
http://www.nabble.com/Timestamp-ignored-tp18205416p18210030.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: Timestamp ignored

2008-06-30 Thread David Blevins

Hi Julia,

OpenEJB is an EJB implementation itself, like JBoss.  If you're  
willing to give OpenEJB a try we can definitely see if we can help you  
get your code running.


-David

On Jun 30, 2008, at 3:06 PM, Julia O wrote:



Hi,

I am using jboss 4.2.0 GA and MySQL 5.0. And cannot get a timestamp to
persist to the database.

I have an @Entity bean with 3 fields: boolean, int. and  
java.sql.Timestamp.
Everything persists except for the timestamp. In fact, i added some  
trace
statements and the getter method for my timestamp is never being  
accessed.


Here is what my getter looks like:
   @Id
   @Temporal(TemporalType.TIMESTAMP)
   @Column(name="report_timestamp")
   public Timestamp getReportTimestamp()
   {
m_log_.info("RETURNING TIMESTAMP " + m_reportTimetamp);
return m_reportTimetamp;
   }

The field maps to a column in mysql database called report_timestamp  
of type

DATETIME. I also used TIMESTAMP without any progress. The persistance
manager keeps inserting nulls into that column.

Additionally, i tried the following mysql drivers in my jboss  
configuration:
mysql-connector-java-5.0.8-bin.jar and mysql-connector-java-5.1.6- 
bin.jar.


Any help would be greatly appreciated.
--
View this message in context: 
http://www.nabble.com/Timestamp-ignored-tp18205416p18205416.html
Sent from the OpenEJB User mailing list archive at Nabble.com.






Timestamp ignored

2008-06-30 Thread Julia O

Hi,

I am using jboss 4.2.0 GA and MySQL 5.0. And cannot get a timestamp to
persist to the database.

I have an @Entity bean with 3 fields: boolean, int. and java.sql.Timestamp.
Everything persists except for the timestamp. In fact, i added some trace
statements and the getter method for my timestamp is never being accessed.

Here is what my getter looks like:
@Id
@Temporal(TemporalType.TIMESTAMP)
@Column(name="report_timestamp") 
public Timestamp getReportTimestamp()
{
m_log_.info("RETURNING TIMESTAMP " + m_reportTimetamp);
return m_reportTimetamp;
}

The field maps to a column in mysql database called report_timestamp of type
DATETIME. I also used TIMESTAMP without any progress. The persistance
manager keeps inserting nulls into that column.

Additionally, i tried the following mysql drivers in my jboss configuration:
mysql-connector-java-5.0.8-bin.jar and mysql-connector-java-5.1.6-bin.jar.

Any help would be greatly appreciated.
-- 
View this message in context: 
http://www.nabble.com/Timestamp-ignored-tp18205416p18205416.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: Antwort: Re: Antwort: Re: Antwort: Re: Using OpenEJB Security for JAAS LoginModule

2008-06-30 Thread Dain Sundstrom

On Jun 30, 2008, at 7:32 AM, [EMAIL PROTECTED] wrote:


Hi David,

Germany lost the Euro2008 therefore I need good news ;-) Do you have  
any

for me?

I confinced my team to use all junit-Tests with openejb as embedded
container in Eclipse :-)

Using my tests, sometimes strange things happen:
* I test the public CRUD-functions of my business class and often I  
get

the expected GREEN color as the result.
* But sometimes the first function of my business class fails. It is a
creation of the business object. The failure happens without any
code-change.

There are two SQL-Insert-Statemens which depend on each other. We  
use the
EntityManager.persist Method. Is it possible the transaction manager  
in
embedded-openejb sometimes use the wrong order for the insert- 
statements ?


FWIU, yes.  By default, OpenJPA does not reorder SQL statements to  
respect foreign keys.  There is an UpdateManager which will respect  
foreign keys, but you have to turn it on with this property:


openjpa 
.jdbc 
.UpdateManager=org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager



BTW, this is about the limits of my knowledge of OpenJPA, so you may  
be better served by asking on the OpenJPA Users mailing list ([EMAIL PROTECTED] 
).


-dain


Re: @ApplicationException(rollback=true) ignored from external API

2008-06-30 Thread Dain Sundstrom

On Jun 25, 2008, at 2:15 PM, David Blevins wrote:

Is the annotated exception class listed in any of the throws clauses  
of the business interface methods in module B?  (where module A has  
the exception class, module B does not)


If so, we could expand our support to looking there too in addition  
to scraping the module jar.


I think we should check exception classes at runtime for the  
annotation.  Normally, this annotation is used for RuntimeExceptions  
which are not required to be listed, and therefore most likely not  
listed.  I also don't think this will add much processing to our  
exception handling code.


If you look at the containers, you will see that they all delegate to  
org.apache.openejb.core.CoreDeploymentInfo#getExceptionType to  
determine if the Exception is an application exception or not.  That  
method basically, checks a Map to determine if the exception was  
explicitly flagged as an application exception, and if not found in  
the map, it checks if the exception is a RuntimeException.  We could  
change that final check to look for an annotation on the class (and up  
the chain if not found).  Finally, once we make a determination about  
an exception class we should record that decision in the Map.  With  
the addition of recording the decision, this should only impact  
exception processing the first time we run into a new exception type.


-dain


Antwort: Re: Antwort: Re: Antwort: Re: Using OpenEJB Security for JAAS LoginModule

2008-06-30 Thread Josef . Eisele
Hi David,

Germany lost the Euro2008 therefore I need good news ;-) Do you have any 
for me?

I confinced my team to use all junit-Tests with openejb as embedded 
container in Eclipse :-)

Using my tests, sometimes strange things happen: 
* I test the public CRUD-functions of my business class and often I get 
the expected GREEN color as the result.
* But sometimes the first function of my business class fails. It is a 
creation of the business object. The failure happens without any 
code-change.

There are two SQL-Insert-Statemens which depend on each other. We use the 
EntityManager.persist Method. Is it possible the transaction manager in 
embedded-openejb sometimes use the wrong order for the insert-statements ? 
We have no errors at all using the code in Geronimo 2.1.1 and sometimes 
errors with the junit-Tests. Where are possible differences in these two 
scenarios?

-Josef





David Blevins <[EMAIL PROTECTED]> 
12.06.2008 09:02
Bitte antworten an
users@openejb.apache.org


An
users@openejb.apache.org
Kopie

Thema
Re: Antwort: Re: Antwort: Re: Using OpenEJB Security for JAAS LoginModule






Hi Josef,

Looks like you do have some custom LoginModules, the Geronimo ones :) 
Those aren't going to run outside of Geronimo, but I've started a 
thread to see if we can get them to be less dependent on the Geronimo 
runtime and therefore more reusable in other settings, like unit tests.

Hopefully we can get some good news for you.

Aside from the login part, I can promise you that the code and process 
*after* the login is exactly the same as the RunAs.  So if you have 
ejbs with security constraints (@RolesAllowed, @DenyAll, @PermitAll, 
etc.) I absolutely guarantee that those *are* testable, just the test 
are assuming a positive login is possible.  Another way to think of it 
as that the login is "mocked" and the enforcement of that Subject is 
100% real.  It should at least allow you to get started and test that 
@RolesAllowed, @DenyAll, @PermitAll, @DeclareRoles and isCallerInRole 
all function as you want them to.  The login part could be added later 
and the RunAs removed with little change to the tests.

-David





BGS Beratungsgesellschaft 
Software Systemplanung AG Niederlassung Rhein/Main 
Robert-Koch-Straße 41 
55129 Mainz 
Fon: +49 (0) 6131 / 914-0 
Fax: +49 (0) 6131 / 914-400 
www.bgs-ag.de Geschäftssitz Mainz 
Registergericht 
Amtsgericht Mainz 
HRB 62 50 
  Aufsichtsratsvorsitzender 
Dr. Wolfgang Trommer 
Vorstand 
Hanspeter Gau 
Hermann Kiefer 
Nils Manegold 
Heinz-Jörg Zimmermann