greptilian logo

IRC log for #javaee, 2013-11-18

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:26 SLovenberg joined ##javaee
00:37 SoniEx2 https://github.com/SoniEx2/TheModernClassicGame/commit/4680f77b709351455a804231367822330ad34334
00:37 SoniEx2 I'm stuck D:
00:46 shoky left ##javaee
00:47 SLovenberg joined ##javaee
01:07 kobain joined ##javaee
01:47 Quest joined ##javaee
07:46 weyer joined ##javaee
08:42 cem_ joined ##javaee
08:43 cem_ how to store 4GB of data in database ?
08:55 sess cem_: probably depends on DB vendor
08:55 sess oracle has max blob size 4gb - 1
08:56 sess wait it was  (4 GB - 1) * DB_BLOCK_SIZE
08:56 sess whatever block size is
09:05 callMeBaby joined ##javaee
09:50 dangertools joined ##javaee
09:50 dangertools joined ##javaee
11:11 drspockbr joined ##javaee
11:52 MegaMatt joined ##javaee
13:32 SoniEx2 I'm not stuck anymore: https://github.com/SoniEx2/TheModernClassicGame/commit/afb41388f0c5340e30756efc56dba0b734eb9523
14:20 Naros joined ##javaee
14:44 Quest joined ##javaee
14:45 Quest password for my nick got compromised
14:45 Quest strange that the guy gave it back...
14:46 Quest and this was the 3rd time
14:49 SoniEx2 O_o
14:51 Quest Gues that was a guy, unless some hacker girl wants to impress me
14:52 SoniEx2 or a hacker guy likes you?
14:52 Quest it would be useless as iam not gay
14:53 SoniEx2 you don't have to be gay to like a gay guy...
14:54 Quest ya, but they are very dangerous to like
14:54 Quest lolz
14:55 SoniEx2 unless you're a hacker yourself...?
14:58 Quest ahm.
14:58 Quest ethical hacker. sometimes.
14:58 Quest not a pro
15:07 Quest SoniEx2,  hows your project going
15:07 Quest what technologies are you working on?
15:08 SoniEx2 it's doing good
15:08 SoniEx2 I'm not stuck anymore
15:08 SoniEx2 https://github.com/SoniEx2/TheModernClassicGame/tree/master/src/com/github/soniex2/tmcg/ym2612
15:10 Quest hm
15:56 Quest joined ##javaee
16:09 jieryn_ joined ##javaee
16:13 jieryn joined ##javaee
16:17 cem_ joined ##javaee
16:21 jieryn anyone know how to write an arquillian test that sets the javax.security.Principal when operating against @ArquillianResource URL
16:21 jieryn ?
16:21 jieryn sorry, java.security.Principal
16:29 cem_ i just cant predict future
16:30 sfisque cem_ but you can have it tell you things… Future<?>
16:32 cem_ sfisque: i thought can start servlet by now but working out things on postgres throw PassiveException();
16:56 sajjadg joined ##javaee
17:08 SLovenberg joined ##javaee
17:26 jypie joined ##javaee
17:48 SLovenberg joined ##javaee
18:01 whartung We had 108 threads trapped in a shared HashMap get today -- whee!
18:01 whartung it was fun, 8 cores pegged!
18:05 acuzio Tahts when you know Queues are needed
18:05 whartung nah, it was a crummy cache. wrong part for the job
18:52 Guest20878 http://stackoverflow.com/questions/20050447/cannot-load-params-in-struts-2-action  any views ?
19:33 weyer joined ##javaee
19:50 WileTheCoyot joined ##javaee
19:50 WileTheCoyot hello everyone
19:50 whartung Wile T Coyot -- SUUPRA Speller!
19:51 WileTheCoyot i want to read a properties file which is located (under eclipse) in <Project Name>/web/WEB-INF/prop.properties
19:52 WileTheCoyot how could i refer to this file in a sinple java class?
19:52 WileTheCoyot for now i use private static final String FILE = "/web/WEB-INF/properties/c3p0.properties";
19:52 WileTheCoyot InputStream inputStream = this.getClass().getClassLoader​().getResourceAsStream(FILE);
19:53 WileTheCoyot this give me null pointer exception
19:53 WileTheCoyot whartung: what do you mean?
19:56 whartung Out here, where the coyotes eat several cats per day, we spell it with an extra E
19:57 WileTheCoyot whartung: i know but my nick doesn't end with E :)
19:57 whartung I noticed
20:00 WileTheCoyot how could i refer to /web/WEB-INF/ in java classes?
20:00 whartung refer to it how?
20:00 WileTheCoyot i want to load a properties file under that dir
20:02 whartung ServletCotext has getRealPath(), so MIGHT be able to use ctx.getRealPath("/WEB-INF/yourfile.properties")
20:03 whartung that would get the actual file on the filesystem
20:03 whartung not sure if WEB-INF is hidden from getRealPath tho
20:03 whartung if it is, you can getRealPath("/") and then build the WEB-INF/propfile parts
20:03 WileTheCoyot whartung: unfortunately i'm not in a servlet
20:04 whartung everything is in a servlet
20:04 whartung if it's in a web ap
20:04 whartung unless it's a thread you started
20:04 whartung filters have access to that as well
20:04 whartung what do you have?
20:04 WileTheCoyot even if i don't extens HttpServlet?
20:04 whartung what do you hae?
20:05 whartung gotta step out...
20:05 whartung biab
20:05 SLovenberg joined ##javaee
20:06 WileTheCoyot i have a storage class (which doesn't extends HttpServlet) that loads the db pool and take the parameter from that file
20:08 WileTheCoyot http://pastebin.com/9H1BPKpf
20:18 WileTheCoyot the path of the file is /web/WEB-INF/pool.properties
20:19 javier joined ##javaee
20:19 WileTheCoyot but tomcat give me nullPointerException
20:26 weyer joined ##javaee
20:40 weyer joined ##javaee
21:06 cem_ joined ##javaee
21:12 jieryn i have a @ManyToMany and a DAO with JPA criteria, i want to select just a subset of the mapping...
21:12 jieryn the collection is Fetch.LAZY, but i can't seem to construct a criteria query to get it
21:13 sfisque does the child have a back reference to the parent?
21:13 sfisque you can do it two ways.   link from child to parent, OR parent_.join( child.class );
21:16 jieryn there's only one reference
21:17 jieryn criteriaQuery.join ?
21:19 jieryn nope
21:20 whartung "select just a subset"?
21:21 whartung you'll have to specifically query for that, you can't filter on a property join
21:21 sfisque can use .fetch() if need to specify limits on the joined entity
21:22 jieryn i do
21:22 sfisque or, like i said earlier, you can link from child to parent and put criteria on the child
21:23 jieryn i have @Entity which has @ManyToMany(LAZY) Collection<Blah> blahs;
21:23 sfisque oh MtoM, yeah, that's a bit trickier
21:23 jieryn i have a DAO where i want to findAllBlahs(Entity, Range)
21:23 jieryn i could just entity.getBlahs().subset(x, y) or something
21:24 jieryn but there may be 20-30k sub rows
21:24 jieryn seems stupid to fetch them all just to winnow them down
21:24 whartung what are you trying to do?
21:24 jieryn get a subset of a @ManyToMany collection
21:24 whartung what subset? How do you define it?
21:24 jieryn @Entity class MyEntity { @ManyToMany Collection<MyBlah> myBlahs; }
21:25 jieryn i don't want to fetch all myBlahs from the database, i only need a few at a time
21:25 whartung no, what are the requirements of your subset? how do determine which ones to get
21:25 jieryn there are no restrictions on it, i want to add sortby and first/max results only
21:26 whartung well obviously there are restrictions. First 100, 1000 random ones, all the green ones, middle 250…what kind of criteria are you using to define your subset?
21:26 whartung what's the use case? paging? sampling? reporting?
21:26 jieryn i seriously and truely do not want to restrict any of them, i just want ot page them
21:26 whartung ok, paging
21:27 whartung so, paging sucks -- period. On any thing with volume.
21:27 whartung it sucks in everything, but particularly in RDBMSs
21:28 jieryn ok, that may be trtue, but i still need to craft a query which will even reference them
21:28 whartung so, you need to do conscious work to manage it properly
21:28 whartung the way to do it
21:28 jieryn i can not even get a jpa criteria query working to reference them
21:28 whartung is via a temporary table
21:28 jieryn there is already a join table
21:28 jieryn jpa automatically created one
21:29 whartung nope, you need a temp table to index the elements in the result set that you are paging through
21:29 jieryn i don't want to keep a reference to the actual pager
21:29 whartung you HAVE to
21:29 jieryn i just want to limit the results by first ordering and then setting the first/max
21:29 jieryn i don't htink so
21:29 whartung ok, don't…it's your database.
21:29 sfisque lolz
21:29 jieryn thanks.
21:30 jieryn anyone else ?
21:30 whartung don't worry, I'll welcome you back when you come to your senses.
21:30 jieryn i wish to your god that did it for me
21:30 sfisque another way you can do it is to model the join table as an entity, but that "can" cause performance issues if you build bad queries
21:31 whartung "Can you help me find my keys?" "Where did you lose them." "Over there." "Why are you looking here?" "The lights better."
21:32 jieryn i am happy to admit i may not be phrasing my question in a manner that you understand
21:32 jieryn i don't know why you have to be such an asshole about it though
21:32 whartung You want to page through a large result set, and order it. Yes?
21:33 jieryn why is it that all database people are like my half retarded cousin that likes moonshine and picking bar fights?
21:33 semiosis who doesn't like moonshine & barfights?
21:33 jieryn :)
21:34 whartung don't have to be half retarded to like moonshine and barfights.
21:34 whartung So, you'r NOT paging a large result set?
21:34 whartung that's not what this is about?
21:34 jieryn i'm not a database person, but i'm fairly sure that 'paging' is a special kind of operation
21:34 jieryn i am not holding a reference to a paged result
21:35 whartung nope, it's not a special kind of operation.
21:35 whartung especially not in a web environment.
21:35 whartung client/server, different problem -- but that's not what folks do today.
21:35 whartung as a rule
21:37 whartung so, which part am I misunderstanding?
21:38 semiosis jieryn: heres the strategy i used for a rest api.... one endpoint to give a count of items (# items available, # per page (constant), # of pages) then a list endpoint which requires a page number param
21:38 whartung how do you fetch the data for a page semiosis
21:39 semiosis GET /items?count=true; GET /items?page=1; GET /items?page=2; .....
21:39 semiosis basically
21:39 whartung How do yu get the data from yur back end store
21:39 semiosis oh right
21:39 whartung yea, that part
21:40 jieryn figuring out how to calculate offsets isn't really all that difficult
21:40 whartung offsets is easy, fetching the data, not so much
21:40 semiosis a named query, which selects the items & orders by date created, setMaxRestuls to MAX_RESULTS and setFirstResultPage to MAX_RESULTS * page
21:40 jieryn referencing via criteria api a Collection<Blah> blahs where CriteriaQuery<Blah> and Root<MyEntity>
21:40 whartung so you don't have a large table
21:40 semiosis s/setFirstResultPage/setFirstResult/
21:41 semiosis whartung: how large is large?
21:41 whartung large enough that your server hates you
21:42 whartung SELECT … FROM … ORDER BY … LIMIT 100 OFFSET 500
21:42 jieryn ok, thanks
21:42 jieryn that really isn't even close to what i'm asking about sorry
21:42 jieryn i think i am not communicating what i am experiencing, thank you, i apologize
21:43 semiosis whartung: servers love me
21:43 whartung That is one of the worst SQL statements you can write :), specifically with large tables.
21:43 whartung but it does depend on the WHERE and ORDER BY clauses
21:43 kobain_ joined ##javaee
21:44 whartung so I should change from "table size" to "result set size", since that's more germane
21:46 semiosis whartung: what alternative do you suggest?
21:46 whartung a work/temporary table
21:47 whartung the problem isn't with the query per se, it's the fact that it's called more than once
21:47 whartung so lets take the extreme case
21:47 whartung of a million row table
21:47 whartung SELECT * FROM table ORDER BY firstName LIMIT 100 OFFSET 1000
21:48 whartung assume firstName is not indexed
21:48 whartung that query just sorted 1M rows
21:48 whartung now, lets' get the next page
21:48 whartung SELECT * FROM table ORDER BY firstName LIMIT 100 OFFSET 1100
21:48 whartung that query, also, just sorted 1M rows
21:48 semiosis clearly
21:48 whartung the original query is long gone
21:48 semiosis so your solution is to sort the whole thing into another table then query that multiple times
21:49 whartung so instead, you have a work table, ideally with a serial key
21:49 whartung yea
21:49 semiosis isn't that what having an index on firstname is?
21:49 whartung INSERT INTO worktable SELECT 0,primaryKey FROM Table
21:49 whartung yes.
21:50 whartung but you can either use an index to SORT the result set, or NARROW the result set, rarely both (unless they're the same thing, right?)
21:51 whartung so obviously, this works great "SELET * FROM table WHERE firstName >= "A" and firstName < "B" ORDER BY firstName
21:51 semiosis but not when ordering by lastname
21:51 whartung current, i fyou want last name your SOL :)
21:51 jaip joined ##javaee
21:52 whartung and, again, if you have a narrow raw result set, the sort is "cheap"
21:52 whartung obviously once you capture the worktable, your result set is stale, but such is life.
21:53 semiosis http://dev.mysql.com/doc/refman/5.5/en/multiple-column-indexes.html
21:53 semiosis looks helpful
21:53 whartung but now you can query by the index first column, and use that instead of LIMIT and OFFSET
21:54 whartung if you're narrowing and ordering by the same indexed columns, then you're fine. but most of the time, folks do't do that
21:55 whartung most pages page by number, not data (rows 1-50, 51-100 vs all the A's and all the B's)
21:56 whartung and its completely different in the Client Server world
21:56 whartung you can do "SELET * FROM TABLE ORDER BY firstName" and just hold the cursor open over the DB connection
21:56 whartung you typically can not do that in a stateless web app
21:56 whartung holding connections is verboten
21:57 whartung (you can do it with a stateful EJB, however ;) )
21:57 whartung but DBA's don't like random users holding there DBs hostage for arbitrary amounts of time
21:59 whartung alas, it wasn't this way back in the golden days of ISAM…then it was easy :)
22:11 cem_ when to use syslog in postgres
22:13 cem_ pdurbin: when to use syslog in postgres
22:22 whartung when you want to route your postgres logs to a syslog server?
22:23 sfisque in production, so that IT doesnt have to monitor multiple log sources per server
22:37 cem_ there are so many log option in postgres i guesss other then default log we can choose
22:38 cem_ one of the feature i liked is inheritance
23:07 whartung log inheritance??
23:14 cem_ no ...colum inheritance
23:28 cem_ org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"
23:29 cem_ even after entering correct password it says wrong
23:34 whartung I guess it's not the correct password then
23:35 cem_ whartung: but i entered the same password to get into CLI and it worked psq; -U postgres and i entered the same password and i logged in
23:35 cem_ psql*
23:36 whartung then there's something else wrong with your request to PG
23:41 cem_ how to check bit mask ?
23:42 cem_ host    postgres             postgres     127.0.0.1/32            password part of my pg_hba,config
23:53 cem_ apparently i cant connect as superuser
23:53 whartung not as root, no
23:53 cem_ A common setup is that you cannot connect as the database user postgres unless you are running as the OS user postgres.
23:53 whartung I haven't seen that
23:54 whartung sure it could be done
23:56 cem_ but how
23:56 sfisque i believe the "default" postgresql setup works like that.  it assumes your os user is the same as the db user
23:56 sfisque but you can reconfigure postgresql to not do that

| 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.