greptilian logo

IRC log for #javaee, 2013-09-27

Please see http://irclog.greptilian.com/javaee for which days have been logged.

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
00:36 neuro_sys joined ##javaee
01:36 sfisque joined ##javaee
03:31 jenue joined ##javaee
04:37 dangertools joined ##javaee
04:37 dangertools joined ##javaee
05:00 tangatools joined ##javaee
05:05 dangertools joined ##javaee
05:07 dangatools joined ##javaee
06:02 Quest joined ##javaee
06:04 dangertools joined ##javaee
06:04 dangertools joined ##javaee
08:50 Fubar^ joined ##javaee
08:59 lamham joined ##javaee
08:59 lamham left ##javaee
11:49 Quest what are good parsers for a. A fixed lenght file / feed that is read at once in full   and   b. a continious feed that is streaming in constantly
11:54 Quest xml ^
11:56 tjsnell javabot has a good list but you're not there
11:58 Quest there are many like jdom. but needed use case  comparison
11:58 Quest brb
13:38 Naros joined ##javaee
13:38 Naros left ##javaee
13:52 jieryn joined ##javaee
13:52 jieryn joined ##javaee
14:10 sfisque you could create a parser grammar and have javacc/antlr/sablecc create the parser engine for you
14:49 neuro_sys damn this small project goes so neat and fun
14:50 jieryn anyone using tomee and standard bundle of openjpa and hsql ? i can not get uniqueconstraints to be honored
15:01 sfisque explain
15:03 brixon_12234 joined ##javaee
15:03 brixon_12234 hi
15:03 brixon_12234 is this the place you go to complain about enterprise java?
15:04 brixon_12234 left ##javaee
15:07 jieryn i'm updating an example project which demonstrates it
15:26 jieryn sfisque: https://github.com/jieryn/javaee-example
15:26 jieryn UserDAOTest#create2 should take an exception because of a unique constraint, but it doesn't
15:27 jieryn we persist two User @Entity that have the same email address, which is a @Table(@UniqueConstraint))
15:42 ramen_ joined ##javaee
15:46 sfisque are you committing between the creates?
15:48 sfisque and what is the PK for your user table?  if it is email, what you're doing is a create by a followup modify.  in jpa, as long as the entities do not do anything "pathological" in their hashcode and equals methods, if the PK == PK, then they are the same object
15:49 whartung either way the DB will bitch if it's unique and and you're violating the constraint, but you won't get that message until you commit
15:49 whartung or at least flush
15:51 sfisque if create() does a detection and persist/updates accordingly (aka, the saveOrUpdate() method of hibernate) then there's no guarantee of that collision because the PKs are the same on the object, thus the first would be detected as a insert and the second one an update.  i havent done a thorough investigation, but i'm offering some possible failure points that can be investigated
15:52 whartung and you also have to consider that all JPA operations are cached. You can do an em.update(duplicateEntity); and it will WORK, it won't fail until you commit or flush the transaction, which is easily far and away from where the insert occurred (such as the SB boundary)
15:53 whartung so it's a different mind set from when you would run a SQL statement and expect it to instantly take affect.
15:53 whartung (or fail)
15:55 jieryn sfisque: if you look at the example project i have there...
15:55 sfisque aye.  generally, the transaction opens when you enter an EJB method (from a non-ejb caller) and closes (commits/rollsback/pauses) when the method returns to "non-ejb space"
15:55 sfisque i quickly perused through it
15:56 jieryn if there is a user error here, it is in persistence.xml
15:56 jieryn even if it is cached, there should be a duplicateentityexception
15:57 sfisque what does @Transactional(TransactionMode.ROLLBACK)
15:57 sfisque do.. i'm familiar with that usage
15:57 sfisque *** i'm not familiar
15:58 jieryn per-@Test transaction isolation
15:58 jieryn so that one @Test testing create does not interfere with another @Test doing create+delete, e.g.
15:58 jieryn i can't imagine why this is not the default, but.. there you have it
15:59 jieryn tests should be totally self-contained and not impact anything else, as they are often run in parallel and out of order
15:59 whartung I've never see a duplicate entity exception out of JPA, it's always been the DB that complained
16:00 jieryn i have
16:01 sfisque it depends how you annotate your entities and what the underlying provider does
16:02 sfisque i'm wondering if the fact that your transactions are marked rollback, that you're not getting the collision (there's no collision because nothings committed)
16:03 whartung you certainly shouldn't get them across transactions.
16:08 jieryn the rollback happens after the test
16:08 jieryn if i do this testcase in a spring project, openjpa throws the exception
16:08 jieryn but my buildSchema in persistence.xml is much different
16:09 jieryn <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ReadSchema=true, SchemaAction='refresh', PrimaryKeys=true, ForeignKeys=true, Indexes=true)" />
16:09 whartung if you flush the enity manager, you will probably get the exception, even with rollback. flushing the transaction played the SQL against the DB, but since you're still in a transaction, the rollback will undo the changes.
16:09 jieryn if i do this in tomee, i am taking a lot of errors.. i think hsqldb sucks, personally, but.. it works in derby
16:09 jieryn ok let me try
16:13 jieryn ok, that triggers it
16:19 jieryn awesome :)
16:21 ramen_ joined ##javaee
16:28 sfisque congrats :-)
16:30 jieryn thanks, sfisque and whartung  :)
16:30 whartung yw
16:37 sfisque npnp, code strong!
17:26 [[thufir]] joined ##javaee
20:20 sfisque joined ##javaee
20:50 Guest31271 joined ##javaee
22:49 roger_ joined ##javaee
22:49 roger_ hello
22:49 roger_ tjsnell: I have doubt
22:50 tjsnell we all do
22:50 whartung the universe vexes us, thus doubt.
22:50 roger_ tjsnell: I new to Java
22:50 roger_ tjsnell: What is super and this
22:50 roger_ I just cant understand
22:51 tjsnell stuff any decent tutorial or book will teach you
22:51 roger_ If going to do certification
22:52 roger_ I'm*
22:53 roger_ whartung: Bro please answer
22:53 roger_ I'm getting confused
22:53 whartung answer what? LIke tjsnell said, sounds like you need to hit the books.
22:54 tjsnell you'll pass
22:54 roger_ what type of books
22:54 tjsnell quantum physics
22:54 roger_ tjsnell: Have you done Certification ?
22:54 tjsnell hell no
22:54 whartung rectangular shaped ones, 2-3" thick, with thin pieces of paper all stacked together and glued on one edge
22:55 tjsnell they are very useful though
22:55 tjsnell you put that on your resume and we're most likely to pass
22:56 roger_ Are you teasing me
22:56 whartung when I see a Certification, I see someone who knows what ingredients are, but doesn't, necessarily, know how to cook.
22:57 tjsnell roger_:  you're some stupid chicken shit who thinks they are clever by being anonymous
22:57 tjsnell big man, hiding who you really are
22:57 tjsnell impressed
22:57 tjsnell ignored
22:57 roger_ tjsnell: ??
22:57 roger_ Wow!
22:58 sfisque you can ignore him,  he vacillates between abrasive and amenable
22:58 whartung heh
22:58 tjsnell he's a troll
22:58 tjsnell it's rather obvious
22:58 roger_ tjsnell: He is mod in Java channel
22:59 roger_ sfisque: Yes
22:59 sfisque regardless, he (rog) asked questions and you responded in a way that was uncalled for
22:59 tjsnell nah
22:59 tjsnell if he asked real questions I'd respond well
23:00 tjsnell I didn't jump on a question to the room I responded to direct questioning
23:00 roger_ tjsnell: lol
23:00 roger_ Do you think this was stupid question
23:00 tjsnell here I'd never just jump in a thread like that even if I thought it completely inane
23:01 sfisque my thought on the question is not in question :P
23:01 sfisque but last i checked this channel wasnt created for your privilege ot drop judgement on people or their questions
23:01 tjsnell if someone is going to distract me from work then I expect better
23:01 tjsnell I've never asked for anything here
23:01 tjsnell I only responded to someone
23:02 sfisque either asnwer or idle, no but you give a lot that isnt asked for
23:02 tjsnell he's a troll, directly addressed me with a troll question and I responded
23:02 tjsnell the powers that be can decide to do whatever with that
23:02 roger_ tjsnell: I'm not a troll
23:02 sfisque so, in your wisdom, you decided to "feed the trolls"….
23:02 sfisque bright
23:02 tjsnell ok, you're ignored too until later
23:03 * sfisque shrugs
23:03 tjsnell I didn't insult you and won't
23:05 roger_ tjsnell: If you dont know the answer dont accuse me as troll :/
23:06 roger_ people please remove Core Java (Java SE)
23:06 roger_ in the title
23:11 whartung left ##javaee
23:11 whartung joined ##javaee
23:13 sfisque wb
23:15 whartung I guess I'm not an operator here any more :)
23:15 whartung kicked from the team...
23:19 roger_ I dont think anyone over here is above 1 year experience in java :/
23:19 roger_ left ##javaee
23:19 whartung ok

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

Please see http://irclog.greptilian.com/javaee for which days have been logged.