You can subscribe to this list here.
2002 |
Jan
(2) |
Feb
(157) |
Mar
(111) |
Apr
(61) |
May
(68) |
Jun
(45) |
Jul
(101) |
Aug
(132) |
Sep
(148) |
Oct
(227) |
Nov
(141) |
Dec
(285) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(518) |
Feb
(462) |
Mar
(390) |
Apr
(488) |
May
(321) |
Jun
(336) |
Jul
(268) |
Aug
(374) |
Sep
(211) |
Oct
(246) |
Nov
(239) |
Dec
(173) |
2004 |
Jan
(110) |
Feb
(131) |
Mar
(85) |
Apr
(120) |
May
(82) |
Jun
(101) |
Jul
(54) |
Aug
(65) |
Sep
(94) |
Oct
(51) |
Nov
(56) |
Dec
(168) |
2005 |
Jan
(146) |
Feb
(98) |
Mar
(75) |
Apr
(118) |
May
(85) |
Jun
(75) |
Jul
(44) |
Aug
(94) |
Sep
(70) |
Oct
(84) |
Nov
(115) |
Dec
(52) |
2006 |
Jan
(113) |
Feb
(83) |
Mar
(217) |
Apr
(158) |
May
(219) |
Jun
(218) |
Jul
(189) |
Aug
(39) |
Sep
(3) |
Oct
(7) |
Nov
(4) |
Dec
(2) |
2007 |
Jan
|
Feb
(2) |
Mar
(7) |
Apr
(3) |
May
(3) |
Jun
(8) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(7) |
Dec
|
2008 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2009 |
Jan
(6) |
Feb
|
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(10) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mohamed <moh...@gm...> - 2009-01-06 09:07:26
|
I just want to say thank you for reminding me again about this option Emmanuel. The last two weeks I have been just trying out different approaches: Compass, Searchable and built in fulltext support DB's. But the fact is that all of them are either too complex or take me away from my hibernate domain model. If I want search, I have to use their API and usually only fulltext search is possible or the queries gets way to complex. I just finished reading : http://www.jroller.com/kimchy/entry/hibernate_search_lucene and I must say that what Shay fails to realize is that it's a little bit too complex using compass, it should be easier (why searchable even go to the surface), new developers don't want to learn yet another thing to use, I have learned so much already I think I will crack soon! :) lol I will give it a try but now I think I have landed now :) About your book, does it cover grails search? I am not familiar with the classic Hibernate XML set ups. Do you have any link to any grails + hibernate search set up. I can't seem to find any... / Moe On Mon, Jan 5, 2009 at 10:45 PM, Mohamed <moh...@gm...>wrote: > Ok, i have now :). Another question I have on my mind. If one performs an > SQL query. Will I be able to return the domain object as HQL or GORM would > have? select domain from domain where ... Will I be able to use the returned > value just like HQL would have returned it, as a domain object? > > > On Mon, Jan 5, 2009 at 10:17 PM, Emmanuel Bernard <emm...@hi...>wrote: > >> Please ask your questions at http://forum.hibernate.org. There is a >> dedicated forum for Hibernate Search :) >> >> On Jan 5, 2009, at 16:14, Mohamed wrote: >> >> Thank you Emmanuel. Can you tell me more about it ? I have spent so much >> time back and forth deciding on how and what should handle my search. I must >> say, I remember that his was a possibility now early in my development but >> none in the grails community have mentioned it as an option when I have >> brought up the search discussion... >> How powerful is it? Compared to lucene ? (ooh now I see that its built on >> lucene)... but how come no one have mentioned it in grails... does this come >> with the normal grails/hibernate distro ? Or is it like a plugin ? >> >> May main reason for going for postgres Tsearch is the possibilty to mix >> fulltext and relational matching... I guess this is not a problem with >> Hibernate search ? Is there any drawbacks I should know about ? >> >> Thank you / Moe >> >> On Mon, Jan 5, 2009 at 9:06 PM, Emmanuel Bernard <emm...@hi...>wrote: >> >>> It is not possible. But I encourage you to look at Hibernate Search for >>> your full text needs. It does not rely on your database capabilities and >>> works as expected in Grails. >>> Also, please ask your questions at http://forum.hibernate.org >>> >>> Emmanuel >>> >>> On Jan 5, 2009, at 13:30, Mohamed wrote: >>> >>> Hi, I am new to this list. I have been using Hibernate through Grails and >>> Gorm for a while now and I just switched my DB to Postgres from MySql to >>> take advantage of the fulltext support in PostgresSql. >>> I was wondering if it is possible and if so, how to write HQL queries >>> that involves the TSearch2. >>> >>> An Sql query would look something like this : >>> >>> select title from someTable where >>> >>> to_tsvector('english', description) @@ to_tsquery('english', 'car') and >>> where name = 'carl'; >>> >>> >>> Where the fulltext search is this part : to_tsvector('english', >>> description) @@ to_tsquery('english', 'car') >>> >>> >>> How does this look like in HQL ? Is this possible to use a DB special >>> features with Hibernate ? >>> >>> / Moe >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> hibernate-devel mailing list >>> hib...@li... >>> https://lists.sourceforge.net/lists/listinfo/hibernate-devel >>> >>> >>> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> hibernate-devel mailing list >> hib...@li... >> https://lists.sourceforge.net/lists/listinfo/hibernate-devel >> >> >> >> > |
From: Mohamed <moh...@gm...> - 2009-01-05 21:52:34
|
Ok, i have now :). Another question I have on my mind. If one performs an SQL query. Will I be able to return the domain object as HQL or GORM would have? select domain from domain where ... Will I be able to use the returned value just like HQL would have returned it, as a domain object? On Mon, Jan 5, 2009 at 10:17 PM, Emmanuel Bernard <emm...@hi...>wrote: > Please ask your questions at http://forum.hibernate.org. There is a > dedicated forum for Hibernate Search :) > > On Jan 5, 2009, at 16:14, Mohamed wrote: > > Thank you Emmanuel. Can you tell me more about it ? I have spent so much > time back and forth deciding on how and what should handle my search. I must > say, I remember that his was a possibility now early in my development but > none in the grails community have mentioned it as an option when I have > brought up the search discussion... > How powerful is it? Compared to lucene ? (ooh now I see that its built on > lucene)... but how come no one have mentioned it in grails... does this come > with the normal grails/hibernate distro ? Or is it like a plugin ? > > May main reason for going for postgres Tsearch is the possibilty to mix > fulltext and relational matching... I guess this is not a problem with > Hibernate search ? Is there any drawbacks I should know about ? > > Thank you / Moe > > On Mon, Jan 5, 2009 at 9:06 PM, Emmanuel Bernard <emm...@hi...>wrote: > >> It is not possible. But I encourage you to look at Hibernate Search for >> your full text needs. It does not rely on your database capabilities and >> works as expected in Grails. >> Also, please ask your questions at http://forum.hibernate.org >> >> Emmanuel >> >> On Jan 5, 2009, at 13:30, Mohamed wrote: >> >> Hi, I am new to this list. I have been using Hibernate through Grails and >> Gorm for a while now and I just switched my DB to Postgres from MySql to >> take advantage of the fulltext support in PostgresSql. >> I was wondering if it is possible and if so, how to write HQL queries that >> involves the TSearch2. >> >> An Sql query would look something like this : >> >> select title from someTable where >> >> to_tsvector('english', description) @@ to_tsquery('english', 'car') and >> where name = 'carl'; >> >> >> Where the fulltext search is this part : to_tsvector('english', >> description) @@ to_tsquery('english', 'car') >> >> >> How does this look like in HQL ? Is this possible to use a DB special >> features with Hibernate ? >> >> / Moe >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> hibernate-devel mailing list >> hib...@li... >> https://lists.sourceforge.net/lists/listinfo/hibernate-devel >> >> >> > > ------------------------------------------------------------------------------ > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > > > |
From: Mohamed <moh...@gm...> - 2009-01-05 21:14:52
|
Thank you Emmanuel. Can you tell me more about it ? I have spent so much time back and forth deciding on how and what should handle my search. I must say, I remember that his was a possibility now early in my development but none in the grails community have mentioned it as an option when I have brought up the search discussion... How powerful is it? Compared to lucene ? (ooh now I see that its built on lucene)... but how come no one have mentioned it in grails... does this come with the normal grails/hibernate distro ? Or is it like a plugin ? May main reason for going for postgres Tsearch is the possibilty to mix fulltext and relational matching... I guess this is not a problem with Hibernate search ? Is there any drawbacks I should know about ? Thank you / Moe On Mon, Jan 5, 2009 at 9:06 PM, Emmanuel Bernard <emm...@hi...>wrote: > It is not possible. But I encourage you to look at Hibernate Search for > your full text needs. It does not rely on your database capabilities and > works as expected in Grails. > Also, please ask your questions at http://forum.hibernate.org > > Emmanuel > > On Jan 5, 2009, at 13:30, Mohamed wrote: > > Hi, I am new to this list. I have been using Hibernate through Grails and > Gorm for a while now and I just switched my DB to Postgres from MySql to > take advantage of the fulltext support in PostgresSql. > I was wondering if it is possible and if so, how to write HQL queries that > involves the TSearch2. > > An Sql query would look something like this : > > select title from someTable where > > to_tsvector('english', description) @@ to_tsquery('english', 'car') and > where name = 'carl'; > > > Where the fulltext search is this part : to_tsvector('english', > description) @@ to_tsquery('english', 'car') > > > How does this look like in HQL ? Is this possible to use a DB special > features with Hibernate ? > > / Moe > > > ------------------------------------------------------------------------------ > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > > |
From: Emmanuel B. <emm...@hi...> - 2009-01-05 20:33:10
|
It is not possible. But I encourage you to look at Hibernate Search for your full text needs. It does not rely on your database capabilities and works as expected in Grails. Also, please ask your questions at http://forum.hibernate.org Emmanuel On Jan 5, 2009, at 13:30, Mohamed wrote: > Hi, I am new to this list. I have been using Hibernate through > Grails and Gorm for a while now and I just switched my DB to > Postgres from MySql to take advantage of the fulltext support in > PostgresSql. > > I was wondering if it is possible and if so, how to write HQL > queries that involves the TSearch2. > > An Sql query would look something like this : > > select title from someTable where > > to_tsvector('english', description) @@ to_tsquery('english', 'car') > and where name = 'carl'; > > > Where the fulltext search is this part : to_tsvector('english', > description) @@ to_tsquery('english', 'car') > > > How does this look like in HQL ? Is this possible to use a DB > special features with Hibernate ? > > / Moe > > ------------------------------------------------------------------------------ > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel |
From: Mohamed <moh...@gm...> - 2009-01-05 18:30:41
|
Hi, I am new to this list. I have been using Hibernate through Grails and Gorm for a while now and I just switched my DB to Postgres from MySql to take advantage of the fulltext support in PostgresSql. I was wondering if it is possible and if so, how to write HQL queries that involves the TSearch2. An Sql query would look something like this : select title from someTable where to_tsvector('english', description) @@ to_tsquery('english', 'car') and where name = 'carl'; Where the fulltext search is this part : to_tsvector('english', description) @@ to_tsquery('english', 'car') How does this look like in HQL ? Is this possible to use a DB special features with Hibernate ? / Moe |
From: Petri R. <pet...@gm...> - 2008-11-14 10:38:16
|
I have been reading Hibernate Core documentation and section 16.1.4 has a little tutorial for multiple entities query: String sql = "SELECT ID as {c.id}, NAME as {c.name}, " + "BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} " + "FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID"; List loggedCats = sess.createSQLQuery(sql) .addEntity("cat", Cat.class) .addEntity("mother", Cat.class).list() 1. ${c.mother} = c.id makes a relation from cat to itself as a mother of itself, is this correct? 2. ${c.XXX} as shorthands are with different alias than entity related to query: addEntity("cat", Cat.class), does Hibernate make a entity relation to FROM part with order of adding with addEntity? In otherwords: CAT_LOG c -> cat as cat is the alias in the first addEntity call CAT_LOG m -> mother as mother is the alias in the second addEntity call 3. how does Hibernate resolve the selected columns: ID as {c.id}, NAME as { c.name}, BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*}, in some columns is c alias and then there is mother.* for the rest, but how this c is related to cat alias? This is totally related to second question. 4. In ID as {c.id} {c.id} means the mapped property in Cat.class, but from which table ID is retrieved, it doesn't have alias listed in FROM part (c or m)? |
From: Jason C. <jas...@gm...> - 2008-10-16 21:02:37
|
I found it. It's actually: hibernate.org -> Documentation -> Core -> Reference Documentation, and then I believe chapter "5" has all the relevant info. The DTD also turned out to be a good source of info. The problem is I had been looking for things related to "XML" not things related to "property". I had also been using Google. Thanks for the tip, everything I was looking for is there, now that I know where to look. Jason On Thu, Oct 16, 2008 at 4:58 PM, Max Rydahl Andersen <max...@re...> wrote: >> 1. Where can I find reference documentation for hibernate XML mapping >> files? (e.g. "these are the attributes that can be used in a property >> element"). > > www.hibernate.org - click Documentation > >> 2. Where is the hibernate users mailing list? I'm posting this to >> hibernate-devel because no other source of help seems to exist. > > www.hibernate.org - click Forum > > /max > |
From: Jason C. <jas...@gm...> - 2008-10-16 16:17:57
|
1. Where can I find reference documentation for hibernate XML mapping files? (e.g. "these are the attributes that can be used in a property element"). 2. Where is the hibernate users mailing list? I'm posting this to hibernate-devel because no other source of help seems to exist. Thanks, Jason |
From: Roland K. <rol...@mt...> - 2008-08-25 08:31:41
|
unsubscribe |
From: umrzyk <um...@gm...> - 2008-08-22 23:00:11
|
hi, i have a simple ManyToMany relation between profile and and roles. there are 3 tables: profile(id, name), profile_role(profile_id, role_id) and role(id, name) and following mapping: @Entity @Table(name = "profile") @SequenceGenerator(name = "PROFILE_SEQ", sequenceName = "profile_id_seq") class Profile { @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY) @Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE }) @JoinTable(name = "profile_role", joinColumns = @JoinColumn(name = "profile_id"), inverseJoinColumns = @JoinColumn(name = "role_id")) @Sort(type = SortType.COMPARATOR, comparator = Role.class) public SortedSet<Role> getRoles() } here is resulting query: select PR.profile_id, PR.role_id, R.id, R.name from profile_role PR left outer join role R on PR.role_id=R.id where PR.profile_id=? it works perfect. well almost, i have just checked session size using MessAdmin tool and something strange appeared. Profile object is 13 MB having only one role inside! Hibernate version is 3.2.2GA. Moreover previously i was using xdoclet for mappings and above getRoles() property was mapped like this: /** * @hibernate.set table="profile_role" cascade="save-update" lazy="true" * @hibernate.collection-key column="profile_id" * @hibernate.collection-many-to-many class="org.model.domain.Role" column="role_id" */ public Set<Role> getRoles() which resulted in following queries: select RP.profile_id, RP.role_id from profile_role RP where RP.profile_id=? select R.id, R.name from role R where R.id=? so previous query has been splitted into 2 separate ones, but resulting object size in session was 14 KB. Could anyone explain me what is the difference between these two xdoclet and annotation mappings and why it has so significant impact on size of resulting PersistenSet ? thanks, jm. |
From: Roland K. <rol...@mt...> - 2008-08-20 06:48:58
|
unsubscribe |
From: Adriano d. S. F. <adr...@uo...> - 2008-08-19 17:32:50
|
Hi! I had this mapping: <class name="VisitaTerceiro" table="visitas_terceiros"> <composite-id> <key-property name="visitaCodigo" column="vis_codigo" /> <key-many-to-one name="terceiro" column="ter_codigo" class="Terceiro" /> <key-property name="tipo" /> </composite-id> <sql-insert check="none"> { call prk_crm.store_doc_visita_terceiro (?, ?, ?) } </sql-insert> </class> My table have unique key on (vis_codigo, ter_codigo, tipo) and a PK (incremented though a sequence) on column codigo. The procedure store_doc_visita_terceiro is responsible to fill the PK. This is used on a set (with one-to-many) in another class. But with this mapping, when store_doc_visita_terceiro is called the composite-id members are uninitialized. To make it work, I had to change the mapping using: <composite-id name="id" class="VisitaTerceiro$Id"> As you see, this make my class very ugly. Without use a name="id", Hibernate considers it a "virtual" property causing the uninitialized members. Why this happen? Is there any better solution? Another problem I had was when I was using <key-many-to-one name="visita" column="vis_codigo" class="Visita" /> instead of "visitaCodigo". This is the column that links the master table with the set. With it, Hibernate enters in infinite recursion and JVM just dies. Is it a Hibernate bug? I'm using Hibernate 3.3. Thanks, Adriano |
From: Lars E. <lar...@ya...> - 2008-07-16 08:45:40
|
Hi! can you describe when i have to choose the hibernate mapping and when i have to use the hql. and can i use hibernate mapping in all cases, i mean if i want to use where, order and so on in a statement.... Tanks Lars |
From: Lars E. <lar...@ya...> - 2008-07-16 06:20:18
|
Hi Everyone! I have a simple question. if i have some like this query select t1.c1, t1.c2 from table1 t1, table t2 where t1.c2 ="something" and t1.c3=t2.c4 How can i use the map for generate this query. I would like use hibernate-mapping not hibernate-query or sql-query. Thanks Lars |
From: nntp://news.gmane.org/ <mm...@gm...> - 2008-02-11 20:00:16
|
Hi everybody, As You can easily understand from the email subject I am troubled with Mysql\Jboss integration. I use JBoss 4.2.2 and I access the MySql DB via a XA Datasource (com.mysql.jdbc.jdbc2.optional.MysqlXADataSource). I define the queries dinamically, accessing an Hibernate session through a Web Application deployed into JBoss. In the following example I want to persist a "Request" object into the XA DS, via an hibernate\jta session. To do this a call a "saveRequest()" method. Every time I do a select against the XA DS everything goes as expected....as soon as I want to do an hibernate "saveRequest()" (which dinamically generates an Hibernate "insert" for the XA DS) I get back this fu__ing jboss exception: (EVERY TIME I EXECUTE AN "INSERT" AGAINST THE XA MYSQL DS I GET BACK THIS:) 19:14:08,373 INFO [STDOUT] Hibernate: insert into request (request_date, contract_id) values (?, ?) 19:14:08,373 WARN [TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@1ae90c9[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@144719c handles=1 lastUse=1202753648227 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1991ccf context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1329346 xaResource=org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper@1a39fdc txSync=null] java.lang.NullPointerException at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.setDate(WrappedPreparedStatement.java:342) ... at org.hibernate.type.DateType.set(DateType.java:44) ) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) at java.lang.Thread.run(Unknown Source) 19:14:08,376 INFO [DateType] could not bind value '11 febbraio 2008' to parameter: 1; Error; - nested throwable: (java.lang.NullPointerException) ... 19:14:08,380 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) 19:14:08,380 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) 19:14:08,380 ERROR [STDERR] at java.lang.Thread.run(Unknown Source) 19:14:08,380 ERROR [STDERR] Caused by: java.lang.NullPointerException 19:14:08,380 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrappedStatement.internalClose(WrappedStatement.java:590) 19:14:08,380 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrappedStatement.close(WrappedStatement.java:75) 19:14:08,380 ERROR [STDERR] at org.hibernate.jdbc.AbstractBatcher.closePreparedStatement(AbstractBatcher.java:534) ... 19:14:08,381 ERROR [STDERR] at com.prj.DataManager.saveRequest(DataManager.java:46) 19:14:08,412 ERROR [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) ... at java.lang.Thread.run(Unknown Source) 19:14:08,413 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion - failed for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@142b123 ... 19:14:08,414 WARN [loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.rollbackxaerror] [com.arjuna.ats.internal.jta.resources.arjunacore.rollbackxaerror] XAResourceRecord.rollback - xa error [com.arjuna.ats.jta.utils.unknownerrorcode] Unknown error code:0 19:14:08,414 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_54] - Top-level abort of action a156303:e9ef:47b08fd5:65 received TwoPhaseOutcome.FINISH_ERROR from <ClassName:RecordType.JTA_RECORD> 19:14:08,415 ERROR [STDERR] javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state ... 19:14:08,417 ERROR [STDERR] at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389) 19:14:08,417 ERROR [STDERR] ... 22 more 19:14:08,417 ERROR [[ReEvaluation]] Servlet.service() for servlet ReEvaluation threw exception ... ) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) at java.lang.Thread.run(Unknown Source) It's really weird because when a try to do the SAME "insert" manually the DBMS works properly. I also tried to define the DATASOURCE as a <local-tx-datasource> and It worked as well!!! Furthermore I made a Junit test which "locally" (without Jboss) persists the "request" object using the same hibernate mappings and It does persist! So...I think the issue is localized in the XA\Transaction Manager interaction....as u can see, everytime i avoid this interaction everything goes right... it's weird, isnt' it?.... :O I start to think that MysqlXADataSource.class in the Mysql .jar connector does not do his dirty job properly.... I hope that somebody having the same Issue found out how to overcome it! Please, answer me to: mm...@gm... Thank You anyway guys. Massi |
From: Ondra Z. <xzi...@st...> - 2008-01-19 09:35:12
|
Hi all, I assume this is the right place to ask, please point me elsewhere if not. I am learning Hibernate and came to such situation: I have a 1:N relation (invoice (faktura) and it's items (polozky)) mapped like: <set name="polozky" table="faktury_polozky" lazy="false" access="field" fetch="join"> <key column="id_faktura"/> <composite-element class="fakturace.Polozka"> <property name="nazev" not-null="true" /> <property name="mnozstvi" not-null="true"/> <property name="jednotka" not-null="true"/> <property name="cenaJednotky" not-null="true"/> </composite-element> </set> But, 1) When I list() the invoices, upon commit() hibernate DELETEs the items' rows from the DB and INSERTs them again with same values. No other action is done; getter returns the same collection object as setter retrieves; and I set access to "field" anyway. So here's the code: // LIST ... else if( "list".equals(args[0]) ){ List res = session.createQuery("FROM Faktura ORDER BY vystaveno ASC").list(); System.out.println("Nalezeno "+res.size()+" faktur.\n"); for (int i = 0; i < res.size(); i++) { Faktura f = (Faktura) res.get(i); System.out.println( f.Vypis() + "\n\n" ); // Vypis() uses only getters. } } // COMMIT + CLOSE System.out.println("------------------------- COMMIT"); session.getTransaction().commit(); And the log after commit: ------------------------- COMMIT Hibernate: delete from faktury_polozky where id_faktura=? and nazev=? and mnozstvi=? and jednotka=? and cenaJednotky=? Hibernate: delete from faktury_polozky where id_faktura=? and nazev=? and mnozstvi=? and jednotka=? and cenaJednotky=? Hibernate: insert into faktury_polozky (id_faktura, nazev, mnozstvi, jednotka, cenaJednotky) values (?, ?, ?, ?, ?) Hibernate: insert into faktury_polozky (id_faktura, nazev, mnozstvi, jednotka, cenaJednotky) values (?, ?, ?, ?, ?) ... etc., for every invoice (faktury) there's a delete and insert. So, what's that I do wrong? And 2), Hibernate does a select for each invoice to get it's items. I wonder whether this is the 1+N problem, because it is not caused by reading collection items one by one. I would expect hibernate to fetch all items with a SELECT like SELECT ... FROM invoice_items WHERE id_invoice IN ( SELECT id FROM invoices WHERE ... << the conditions generated from the HQL query >> ) At least that's the way I would do it in MySQL; currently I play with HSQL, maybe it's not capable of this. So is this normal? Thanks for any useful hints. Ondra Zizka |
From: Andre S. <And...@ci...> - 2007-11-23 14:36:54
|
Hallo, =20 I have a problem with SingletonEHCache. If I create a new Object it is = created a new row in database table. But if I take a findAll() after = create then I don`t see the new Object. The same effect during delete a = Object. In Database it is deleted. During findAll() after delete it come = a=20 =20 org.hibernate.ObjectNotFoundException: No row with the given identifier = exists =20 That show me that cache is not up-to-date. But with CacheStrategie: = read-write the cache should be up-to-date. =20 But if I setmaxElementsInMemory to a low value(1) the I see a differnt = between the cache before/after the create/delete. =20 After some minutes after timeToLive when the values read new from DB in = cache the display shows the correct data.=20 =20 I hope you can help me. =20 Thanks. =20 Andre =20 =20 Hibernate: 3.2.1 EHCache: 1.2.3 =20 SecondLevelCache on SecondLevelCacheProvider: SingletonEHCache SecondLevelCacheStrategie: read-write |
From: Andre S. <And...@ci...> - 2007-11-23 13:13:59
|
Hallo, =20 I have a problem with SingletonEHCache. If I create a new Object it is = created a new row in database table. But if I take a findAll() after = create then I don`t see the new Object. The same effect during delete a = Object. In Database it is deleted. During findAll() after delete it come = a=20 =20 org.hibernate.ObjectNotFoundException: No row with the given identifier = exists =20 That show me that cache is not up-to-date. But with CacheStrategie: = read-write the cache should be up-to-date. =20 But if I setmaxElementsInMemory to a low value(1) the I see a differnt = between the cache before/after the create/delete. =20 After some minutes after timeToLive when the values read new from DB in = cache the display shows the correct data.=20 =20 I hope you can help me. =20 Thanks. =20 Andre =20 =20 Hibernate: 3.2.1 EHCache: 1.2.3 =20 SecondLevelCache on SecondLevelCacheProvider: SingletonEHCache SecondLevelCacheStrategie: read-write |
From: Shardayyy <sha...@gm...> - 2007-11-21 14:19:25
|
From: Massip, E. <Eti...@sa...> - 2007-11-21 10:25:31
|
Did you try to set cascade to the value I mentioned in my previous post = ? The project entry should not be deleted, if that's what you meant. ________________________________ De : Ingo Villnow [mailto:ing...@go...]=20 Envoy=E9 : mercredi 21 novembre 2007 11:20 =C0 : Massip, Etienne Objet : Re: [Hibernate] problems with cascade If I delete the entry in the project-table than the childs will be = deleted, to.. that's all fine. But i only want to delete the children, = without deleting the parent entry, for example = "project.getManagers().clear() - The problem is that it would be hard to = find all manager-elements by projectid and to delete them one by = another. Is there an easier way?=20 thanks 2007/11/21, Massip, Etienne <Eti...@sa...>:=20 No a hibernate member, but maybe cascade=3D"all, delete-orphan" could = do the trick ? ________________________________ De : hib...@li... = [mailto:hib...@li...] De la part de = Ingo Villnow Envoy=E9 : mercredi 21 novembre 2007 11:05 =C0 : hib...@li... Objet : [Hibernate] problems with cascade =09 =09 =09 Hello, =09 i have the following problem. i have a table "projects" and a table = "managers" with a i think called "1:N" relationship. =09 My mapping file (partly): =09 <hibernate-mapping> <class name=3D"....Project" table=3D"Project"> <set name=3D"managers" inverse=3D"true" cascade=3D"all"> <key> <column name=3D"Projectid" not-null=3D"true" /> </key> <one-to-many class=3D".....Manager" /> </set> </class> </hibernate-mapping> =09 Now i want to delete all my managers concerning one special project and = add the new manager. So I do the following: =09 Manager manager; ProjectDAO dao =3D new ProjectDAO(); Project project =3D (Project) dao.getSession().get(Project.class, = projectID); Set managers =3D project.getManagers(); managers.clear(); manager =3D new Manager(); manager.setEmployee(employee_manager); manager.setFunction(managerFunction); manager.setProject(project); dao.getSession().save(manager); managers.add(manager); project.setManagers(managers); dao.save(project); =09 But the thing is that only the new manager was added. The other = database entries were not deleted. I thought, if i update the parent = entry (project) the child entrys will be deleted automatically = (project.getManagers.clear()). Where is my problem? Can anybody help? =09 Thank you very much!!! =09 Greetings from Berlin! =09 Ingo =09 = -------------------------------------------------------------------------= This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ hibernate-devel mailing list hib...@li... https://lists.sourceforge.net/lists/listinfo/hibernate-devel=20 =09 =09 --=20 Liebe Gr=FC=DFe Ingo sites: http://www.herrgustav.de http://www.myspace.com/herrgustav=20 http://www.myspace.com/mrvill =20 mailto: Ing...@we... - Mr...@we... - Vil...@gm...=20 |
From: Massip, E. <Eti...@sa...> - 2007-11-21 10:13:13
|
No a hibernate member, but maybe cascade=3D"all, delete-orphan" could do = the trick ? ________________________________ De : hib...@li... = [mailto:hib...@li...] De la part de = Ingo Villnow Envoy=E9 : mercredi 21 novembre 2007 11:05 =C0 : hib...@li... Objet : [Hibernate] problems with cascade Hello, i have the following problem. i have a table "projects" and a table = "managers" with a i think called "1:N" relationship. My mapping file (partly): <hibernate-mapping> <class name=3D"....Project" table=3D"Project"> <set name=3D"managers" inverse=3D"true" cascade=3D"all"> <key> <column name=3D"Projectid" not-null=3D"true" /> </key> <one-to-many class=3D".....Manager" /> </set> </class> </hibernate-mapping> Now i want to delete all my managers concerning one special project and = add the new manager. So I do the following: Manager manager; ProjectDAO dao =3D new ProjectDAO(); Project project =3D (Project) dao.getSession().get(Project.class, = projectID); Set managers =3D project.getManagers(); managers.clear(); manager =3D new Manager(); manager.setEmployee(employee_manager); manager.setFunction(managerFunction); manager.setProject(project); dao.getSession().save(manager); managers.add(manager); project.setManagers(managers); dao.save(project); But the thing is that only the new manager was added. The other database = entries were not deleted. I thought, if i update the parent entry = (project) the child entrys will be deleted automatically = (project.getManagers.clear()). Where is my problem? Can anybody help? Thank you very much!!! Greetings from Berlin! Ingo |
From: Ingo V. <ing...@go...> - 2007-11-21 10:04:44
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body bgcolor="#ffffff" text="#000000"> Hello,<br> <br> i have the following problem. i have a table "projects" and a table "managers" with a i think called "1:N" relationship.<br> <br> My mapping file (partly):<br> <font face="Courier New"><br> <hibernate-mapping><br> <class name="....Project" table="Project"><br> <set name="managers" inverse="true" cascade="all"><br> <key><br> <column name="Projectid" not-null="true" /><br> </key><br> <one-to-many class=".....Manager" /><br> </set><br> </class><br> </hibernate-mapping></font><br> <br> Now i want to delete all my managers concerning one special project and add the new manager. So I do the following:<br> <font face="Courier New"><br> Manager manager;<br> ProjectDAO dao = new ProjectDAO();<br> Project project = (Project) dao.getSession().get(Project.class, projectID);<br> Set managers = project.getManagers();<br> <b>managers.clear();</b><br> manager = new Manager();<br> manager.setEmployee(employee_manager);<br> manager.setFunction(managerFunction);<br> manager.setProject(project);<br> <b>dao.getSession().save(manager);<br> managers.add(manager);</b><br> </font><b><font face="Courier New">project.setManagers(managers);<br> dao.save(project);</font><br> </b><br> But the thing is that only the new manager was added. The other database entries were not deleted. I thought, if i update the parent entry (project) the child entrys will be deleted automatically (project.getManagers.clear()). Where is my problem? Can anybody help?<br> <br> Thank you very much!!!<br> <br> Greetings from Berlin!<br> <br> Ingo<br> </body> </html> |
From: Mark V. <ma...@ve...> - 2007-11-04 01:01:32
|
Hello all! I'm new to this maling list and to hibernate so please bear with me (meanin= g=20 you can flame me but not roast me...). And now to business... I noticed that the "@Column" annotation does not have a "description"=20 attribute. This is most saddening since such a description could be used in= =20 many ways. for example: 1. The description could be used for documenting the database structure usi= ng=20 hibernate-tools. 2. The description could be pushed out to the database itself using "CREATE= =20 table () description "This is a table to store customers" or the like. Some= =20 database support this and will actually store the description for you which= =20 makes it easier to use the database even if you don't have documentation fo= r=20 it. 3. Many other ways of which I hadn't tought about (probably the most=20 interesting ones). A few questions: 1. Is such a feature in the works ? Even if this feature will only be=20 supported on some of database engines the documentation could state so and = it=20 would still be useful... 2. If a feature like this is not in the works would you like me to implemen= t=20 it ? I'm a java developer and have had my own database persistency system=20 written in perl so I can handle a task like this. I would be able to do it= =20 only for mysql tough because that is all I have now (maybe for postgresql=20 later on). Other people will need to implement it for other database driver= s. 3. What about translations of such descriptions to other locales ? I need t= o=20 think about that some more and your ideas are welcome... 4. I would assume that if hibernate annotations would support it then first= =20 the change should go in through hibernate core, then support should be adde= d=20 in the XML files, then at the annotation level and finally at the tools=20 level. Am I right ? BTW: I noticed that <hbm2doc> already creates html page= s=20 with "description" on them but the descriptions are empty. Cheers, Mark |
From: Lieven D. <ld...@sc...> - 2007-10-29 07:37:44
|
Nevermind, We found out we need to subclass the MySQLDialect class we're using and manipulate the type mapping over there... Thx, Lieven Lieven Doclo schreef: > Hi guys, > > Does anyone of you know how to manipulate the type mapping system in > Hibernate when it comes to auto-ddl'ing persistent classes? > > My problem exists in the mapping of boolean types with Hibernate to > MySQL. It maps the boolean type to BIT(1). Due to some factors (one of > which is the annoying MySQL console problem with the BIT datatype) we > need to use TINYINT(1) (or BOOLEAN, which is an alias for that type). > > You can probably annotate each property with > @Column(columnDefinition="TINYINT(1)"), but that's an option we'd rather > not use... Is there a way to manipulate how Hibernate maps boolean type, > e.g. java.lang.Boolean = TINYINT(1) instead of java.lang.Boolean = BIT? > > Kind regards, > > Lieven DOCLO > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ |
From: Lieven D. <ld...@sc...> - 2007-10-29 07:25:14
|
Hi guys, Does anyone of you know how to manipulate the type mapping system in Hibernate when it comes to auto-ddl'ing persistent classes? My problem exists in the mapping of boolean types with Hibernate to MySQL. It maps the boolean type to BIT(1). Due to some factors (one of which is the annoying MySQL console problem with the BIT datatype) we need to use TINYINT(1) (or BOOLEAN, which is an alias for that type). You can probably annotate each property with @Column(columnDefinition="TINYINT(1)"), but that's an option we'd rather not use... Is there a way to manipulate how Hibernate maps boolean type, e.g. java.lang.Boolean = TINYINT(1) instead of java.lang.Boolean = BIT? Kind regards, Lieven DOCLO |