beankeeper-discussion Mailing List for BeanKeeper
Brought to you by:
demonsystem
You can subscribe to this list here.
2009 |
Jan
(1) |
Feb
(17) |
Mar
(24) |
Apr
(13) |
May
(5) |
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
From: Sergey O. <so...@gm...> - 2011-12-14 09:53:11
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body text="" bgcolor=""> First of all -- thanks for replying!<br> <br> I can understand the logic behind not wanting to do Session mechanism -- even if I don't necessarily agree with it (because it makes working with persistent objects completely different from working with POJOs).<br> <br> With that said, I have a question. Let's take a look at the following pseudo-code (which is something I actually encountered trying to use BeanKeeper):<br> tx<br> {<br> a = find... // retrieve persistent object from BeanKeeper, it has 'list' property with list containing 2 elements.<br> instance1 = a.list.get(1);<br> instance1.update()<br> instance1.save()<br> instance2 = a.list.get(0); // Before 1 above -- this is important!<br> instance2.update()<br> instance2.save()<br> instance3 = a.list.get(1); // instance3 != instance1 at this point!!!<br> instance3.update2()<br> instance3.save()<br> }<br> txcommit<br> <br> As the result of all this I find that changes made in instance1.update() (to the instance1 fields) are NOT persisted. I'm guessing here that reading list backwards causes BeanKeeper to discard and recreate get(1) element because of performance optimizations (where it reads several items at once rather than just one). This in turn means that code operates on two different Java instances for get(1) and attempts to change and save both -- with changes made to instance1 subsequently lost.<br> <br> What I'm wondering about -- is this considered a bug or a feature? If it is a feature, what is the rule-of-thumb for working with BeanKeeper that'll prevent me from losing updates like the example above?<br> <br> Best regards,<br> Sergey<br> <br> On 13.12.2011 21:46, Bräutigam Róbert wrote: <blockquote cite="mid:4EE...@ne..." type="cite"> <pre wrap="">On 12/08/2011 04:31 PM, Sergey Olefir wrote: > Hi, > > I am not sure if this list is even alive anymore, but let's see Hi, The list is alive and monitored, however BeanKeeper is not actively developed anymore. I still think its approach is a valid one, but unfortunately all the developers (the few we've had) moved on to other projects, including myself. > Recently I've been trying to use BeanKeeper. It seemed to cover mostly > what I need and is very simple to use -- which is great! Glad to hear that. > However now I discovered something that has me completely confused. I > assumed that BeanKeeper manages Java object instances -- to give a > really trivial example -- if I query for something by its unique ID > twice, I'd expect to receive the same Java object instance both times. > However this not appears to be the case? You are correct, this is not the case, and on purpose. The reason is that BeanKeeper tries to be as simple as possible even if that means it does not fit all use-cases. BeanKeeper doesn't have any notion of a "Session" (of course it does have a notion of a Transaction though). It doesn't manage bean instances for you like Hibernate does. I believe for somebody not coming from Hibernate (which should be really rare these days), this is actually more intuitive. The rule is: any object you receive is completely clear, and does not in any way have any side-effects. It does not persist automatically, it does not influence other instances in your JVM, etc. > Best regards, > Sergey Robert. ------------------------------------------------------------------------------ Systems Optimization Self Assessment Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. <a class="moz-txt-link-freetext" href="http://www.accelacomm.com/jaw/sdnl/114/51450054/">http://www.accelacomm.com/jaw/sdnl/114/51450054/</a> _______________________________________________ Beankeeper-discussion mailing list <a class="moz-txt-link-abbreviated" href="mailto:Bea...@li...">Bea...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/beankeeper-discussion">https://lists.sourceforge.net/lists/listinfo/beankeeper-discussion</a> </pre> </blockquote> </body> </html> |
From: Bräutigam R. <de...@ne...> - 2011-12-13 19:46:14
|
On 12/08/2011 04:31 PM, Sergey Olefir wrote: > Hi, > > I am not sure if this list is even alive anymore, but let's see Hi, The list is alive and monitored, however BeanKeeper is not actively developed anymore. I still think its approach is a valid one, but unfortunately all the developers (the few we've had) moved on to other projects, including myself. > Recently I've been trying to use BeanKeeper. It seemed to cover mostly > what I need and is very simple to use -- which is great! Glad to hear that. > However now I discovered something that has me completely confused. I > assumed that BeanKeeper manages Java object instances -- to give a > really trivial example -- if I query for something by its unique ID > twice, I'd expect to receive the same Java object instance both times. > However this not appears to be the case? You are correct, this is not the case, and on purpose. The reason is that BeanKeeper tries to be as simple as possible even if that means it does not fit all use-cases. BeanKeeper doesn't have any notion of a "Session" (of course it does have a notion of a Transaction though). It doesn't manage bean instances for you like Hibernate does. I believe for somebody not coming from Hibernate (which should be really rare these days), this is actually more intuitive. The rule is: any object you receive is completely clear, and does not in any way have any side-effects. It does not persist automatically, it does not influence other instances in your JVM, etc. > Best regards, > Sergey Robert. |
From: Marcel S. <ma...@fr...> - 2011-12-09 20:08:12
|
On 09.12.11 21:03, Sergey Olefir wrote: > With Hibernate everything you load within the scope of one Session > (which for e.g. web application you'd usually set to span the entire > request processing) is guaranteed to have one Java instance per one > database object / row -- i.e. no matter how you load the object, it'll > resolve to the same Java instance. Right, as long as the session-scope is what you're after that's correct. I thought your requirement was to get the same object for consecutive requests, sorry. Cheers, Marcel -- Marcel Stör, http://www.frightanic.com Couchsurfing: http://www.couchsurfing.com/people/marcelstoer O< ascii ribbon campaign - stop html mail - www.asciiribbon.org |
From: Sergey O. <so...@gm...> - 2011-12-09 20:03:48
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> </head> <body text="" bgcolor=""> <br> With Hibernate everything you load within the scope of one Session (which for e.g. web application you'd usually set to span the entire request processing) is guaranteed to have one Java instance per one database object / row -- i.e. no matter how you load the object, it'll resolve to the same Java instance.<br> <br> <a class="moz-txt-link-freetext" href="http://docs.jboss.org/hibernate/core/3.3/reference/en/html/transactions.html">http://docs.jboss.org/hibernate/core/3.3/reference/en/html/transactions.html</a><br> "For objects attached to a particular Session (i.e., in the scope of a Session), the two notions are equivalent and JVM identity for database identity is guaranteed by Hibernate."<br> <br> The same is true for general JPA. This is basically has been a cornerstone on which Hibernate / JPA is built. That's why I was so surprised it's not apparently true for BeanKeeper.<br> <br> For what it worth, I've done a bit of code digging and I'm going to bet that indeed in BeanKeeper if you reach a database object instance / row via different paths (via different query or by following a different set of collections) -- you'll have a different Java instance unlike traditional ORM.<br> <br> It also seems that it would be trivially easy to add some kind of Session support to BeanKeeper, but it cannot be done externally (requires modification of BeanKeeper's code directly).<br> <br> However after actually trying to develop minor application on BeanKeeper I found other limitations and shortcomings -- particularly inability to have attribute with the same name in two classes if they share a common parent and incompatibility with most recent HSQLDB. So it seems a serious risk to invest into BeanKeeper as it shows that it hasn't been developed/maintained for a while. But given how much I like it conceptually, I might still give it a shot.<br> <br> It's a pity it hadn't gained a following and seems to be 'mostly dead' for now as it seems it truly has serious potential as a proper way to do objects persistence in Java without all the mess associated with even good ORM (Hibernate) to say nothing of a worse solutions (EJB pre version 3 anyone?).<br> <br> On 09.12.2011 21:02, Marcel Stör wrote: <blockquote cite="mid:4EE...@fr..." type="cite"> <pre wrap="">On 08.12.11 16:31, Sergey Olefir wrote: </pre> <blockquote type="cite"> <pre wrap="">Hi, I am not sure if this list is even alive anymore, but let's see :) </pre> </blockquote> <pre wrap=""> I didn't get a message in years. So yeah, I'll be interested myself. </pre> <blockquote type="cite"> <pre wrap="">Recently I've been trying to use BeanKeeper. It seemed to cover mostly what I need and is very simple to use -- which is great! However now I discovered something that has me completely confused. I assumed that BeanKeeper manages Java object instances -- to give a really trivial example -- if I query for something by its unique ID twice, I'd expect to receive the same Java object instance both times. However this not appears to be the case? </pre> </blockquote> <pre wrap=""> I don't know for sure but I wouldn't be surprised if what you're seeing is the expected behavior. I realize that there may be use cases where such a behavior would be helpful but AFAIK you can't count on it with any ORM tool. With Hibernate for example you could achieve what you want only if use a second level cache (if I'm not mistaken). </pre> <blockquote type="cite"> <pre wrap="">For example, if I execute the following twice in a row: log.info("Offer lookup result HASH: " + System.identityHashCode(DbService.findSingle("find DbOffer where DbOffer.offerId = '" + offer.getId() + "'"))); I get different hash codes. This seems very weird to me -- how do I work with a rich data model when I can't count on the same object to be represented by the same instance? For example, I have two different paths to the same instance via Lists and Maps -- and it seems that I'll be working with different instance depending on which path I take -- and if I use both paths, it'll probably result in a mess. Am I missing something here? Best regards, Sergey ------------------------------------------------------------------------------ Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! <a class="moz-txt-link-freetext" href="http://www.accelacomm.com/jaw/sfnl/114/51491232/">http://www.accelacomm.com/jaw/sfnl/114/51491232/</a> _______________________________________________ Beankeeper-discussion mailing list <a class="moz-txt-link-abbreviated" href="mailto:Bea...@li...">Bea...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/beankeeper-discussion">https://lists.sourceforge.net/lists/listinfo/beankeeper-discussion</a> </pre> </blockquote> <pre wrap=""> </pre> </blockquote> </body> </html> |
From: Marcel S. <ma...@fr...> - 2011-12-09 19:17:42
|
On 08.12.11 16:31, Sergey Olefir wrote: > Hi, > > I am not sure if this list is even alive anymore, but let's see :) I didn't get a message in years. So yeah, I'll be interested myself. > Recently I've been trying to use BeanKeeper. It seemed to cover mostly > what I need and is very simple to use -- which is great! > > However now I discovered something that has me completely confused. I > assumed that BeanKeeper manages Java object instances -- to give a > really trivial example -- if I query for something by its unique ID > twice, I'd expect to receive the same Java object instance both times. > However this not appears to be the case? I don't know for sure but I wouldn't be surprised if what you're seeing is the expected behavior. I realize that there may be use cases where such a behavior would be helpful but AFAIK you can't count on it with any ORM tool. With Hibernate for example you could achieve what you want only if use a second level cache (if I'm not mistaken). > For example, if I execute the following twice in a row: > log.info("Offer lookup result HASH: " + > System.identityHashCode(DbService.findSingle("find DbOffer where > DbOffer.offerId = '" + offer.getId() + "'"))); > I get different hash codes. > > This seems very weird to me -- how do I work with a rich data model when > I can't count on the same object to be represented by the same instance? > For example, I have two different paths to the same instance via Lists > and Maps -- and it seems that I'll be working with different instance > depending on which path I take -- and if I use both paths, it'll > probably result in a mess. > > Am I missing something here? > > Best regards, > Sergey > > > ------------------------------------------------------------------------------ > Cloud Services Checklist: Pricing and Packaging Optimization > This white paper is intended to serve as a reference, checklist and point of > discussion for anyone considering optimizing the pricing and packaging model > of a cloud services business. Read Now! > http://www.accelacomm.com/jaw/sfnl/114/51491232/ > > > > _______________________________________________ > Beankeeper-discussion mailing list > Bea...@li... > https://lists.sourceforge.net/lists/listinfo/beankeeper-discussion -- Marcel Stör, http://www.frightanic.com Couchsurfing: http://www.couchsurfing.com/people/marcelstoer O< ascii ribbon campaign - stop html mail - www.asciiribbon.org |
From: Sergey O. <ser...@we...> - 2011-12-08 15:31:53
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> </head> <body text="" bgcolor=""> Hi,<br> <br> I am not sure if this list is even alive anymore, but let's see :)<br> <br> Recently I've been trying to use BeanKeeper. It seemed to cover mostly what I need and is very simple to use -- which is great!<br> <br> However now I discovered something that has me completely confused. I assumed that BeanKeeper manages Java object instances -- to give a really trivial example -- if I query for something by its unique ID twice, I'd expect to receive the same Java object instance both times. However this not appears to be the case?<br> <br> For example, if I execute the following twice in a row:<br> log.info("Offer lookup result HASH: " + System.identityHashCode(DbService.findSingle("find DbOffer where DbOffer.offerId = '" + offer.getId() + "'")));<br> I get different hash codes.<br> <br> This seems very weird to me -- how do I work with a rich data model when I can't count on the same object to be represented by the same instance? For example, I have two different paths to the same instance via Lists and Maps -- and it seems that I'll be working with different instance depending on which path I take -- and if I use both paths, it'll probably result in a mess.<br> <br> Am I missing something here?<br> <br> Best regards,<br> Sergey<br> </body> </html> |
From: Brautigam R. <de...@ne...> - 2011-03-31 17:40:11
|
On 03/30/2011 09:50 AM, rick dong wrote: > Hi I am just wondering if there are any plans of merging the historical > retention patch into trunk/? My thoughts are that this feature would > probably be quite important to applications that do not requires > historical tracking. Thanks. Hi Rick, Historical tracking will be always a part of how BeanKeeper works, because it's basic transactionality is based on keeping track of object versions. However, there is a feature requested to be able to purge some historical data after a given period of time. Note, that this will not prevent creation of said data. Unfortunately I can not give you a timeline for this. > Rick Robert. |
From: rick d. <seg...@ho...> - 2011-03-30 07:51:04
|
Hi I am just wondering if there are any plans of merging the historical retention patch into trunk/? My thoughts are that this feature would probably be quite important to applications that do not requires historical tracking. Thanks. Rick |
From: <jee...@ya...> - 2010-10-06 18:27:09
|
http://yorkshiremel.com.br/und9.html |
From: Brautigam R. <de...@ne...> - 2010-04-12 16:05:34
|
ihammerhands2000 wrote: > Hi, I am a new user to this great framework, but I do have one question > before I fully adopt this: Is it safe to externally modify the data? Hi, The meta-data added by BeanKeeper is very important for data integrity reasons. Therefore it is not safe to modify the data externally. You can read the data without issues if you want to, but if you modify the data from external source, it may cause an inconsistent state for running BeanKeeper nodes. > Reading over the docs (specifically > http://beankeeper.netmind.hu/doc/beankeeper_3.html#SEC20) it says that > seperate persistence_* tables are created and in each table there is a > persistence_id column for some sort of tracking. This leads me to > believe that if I use this product, I will be locked into it because of > all the management of the database. Every table has meta-data in it additionally to the normal data of your classes/objects. I wouldn't say you become locked to BeanKeeper, because the library itself tries to create as readable databases as possible. It means, if you later want to move away from BeanKeeper, the migration should be as easy as removing historical records and dropping the meta-data columns, so nothing fancy. > So, can this be modified outside of this Java library safely (I'm going > to be using php for the webpage frontend)? Unfortunately I don't think that would work. Although if you want to use PHP instead of Java, maybe you can create some kind of binding to use BeanKeeper anyway.. I don't know enough PHP to know whether that's possible or not. Unfortunately I feel you would be better off with a native PHP ORM library. > Thanks Robert. |
From: ihammerhands2000 <iha...@ya...> - 2010-04-12 02:56:49
|
Hi, I am a new user to this great framework, but I do have one question before I fully adopt this: Is it safe to externally modify the data? Reading over the docs (specifically http://beankeeper.netmind.hu/doc/beankeeper_3.html#SEC20) it says that seperate persistence_* tables are created and in each table there is a persistence_id column for some sort of tracking. This leads me to believe that if I use this product, I will be locked into it because of all the management of the database. So, can this be modified outside of this Java library safely (I'm going to be using php for the webpage frontend)? Thanks |
From: Brautigam R. <de...@ne...> - 2010-03-17 17:32:54
|
Hi all, I'm proud to announce that with the new 2.6.3 release (which is only a bugfixes release) BeanKeeper is now available from the central Maven repository. The dependency description is the following: <dependency> <groupId>hu.netmind.beankeeper</groupId> <artifactId>beankeeper</artifactId> <version>2.6.3</version> </dependency> As always, any feedback is welcome. Robert. |
From: Brautigam R. <de...@ne...> - 2010-01-17 13:53:00
|
Hi all, A new release (2.6.2) is published. All open bugs were fixed in this release from the Sourceforge bug tracking page. The main focus was continuing the refactorization efforts started in the previous 2.6.1 release. Currently BeanKeeper is moving toward a service oriented internal architecture, in which properly separated modules are injected to eachother instead of using lookup and direct references to implementations. There is still much work to be done, as there are still services which do not have proper interfaces, like the database part, and the query language part. As a sidenote, BeanKeeper is not yet automatically synchronized into the central maven repository unfortunately. The request was created last year 22th Nov here: http://jira.codehaus.org/browse/MAVENUPLOAD-2669 As another sidenote, I submitted (again) an abstract to the 2010 Jazoon conference, for a short talk. It would be very good for the project to receive some spotlight, and of course it would be good for my ego too :) If you have ideas which direction BeanKeeper should go in, please don't hesitate to write! The default direction is continue refactoring, and improving internal architecture for now. Happy new year (first post this year), Robert. |
From: Brautigam R. <de...@ne...> - 2010-01-01 18:55:16
|
Gil Levendel wrote: > Hi all, > > I've done some experimentation with Java enum + beankeeper and am > getting an exception when attempting to store an object containing on > enum (presumably because the enum has no public default constructor). > > I've dug around the mailing list archives, feature request list, etc but > haven't seen any thread on this topic. > > What's the best way to work around this...? Does the lack of a default > constructor mean that enum's will likely be difficult or impossible to > support? I would think, that support for enums should be easy. If you don't see it in the feature requests in sourceforge, please add it. I'm thinking it should be easy to just store an enum as a string and then unmarshall based in this string value. Which means we don't actually need to instantiate the enum object, just lookup the static value of it or something... > Thanks and Happy New Year! > Gil Back at'ya. Robert. |
From: Gil L. <jee...@ya...> - 2009-12-31 15:15:40
|
Hi all, I've done some experimentation with Java enum + beankeeper and am getting an exception when attempting to store an object containing on enum (presumably because the enum has no public default constructor). I've dug around the mailing list archives, feature request list, etc but haven't seen any thread on this topic. What's the best way to work around this...? Does the lack of a default constructor mean that enum's will likely be difficult or impossible to support? Thanks and Happy New Year! Gil |
From: Brautigam R. <de...@ne...> - 2009-11-22 15:41:28
|
Marcel Stör wrote: > On 22.11.2009, at 12:43, Brautigam Róbert wrote: > >> Hi all, >> >> After a bit of time off, here is the new release of BeanKeeper, 2.6.1. > > A new release is always a good sign ;-) > >> [...] >> >> Also, a maven repository was finally created on sourceforge, and the >> request was submitted to sync it to the central maven repository, so >> BeanKeeper will be available for projects using maven through normal >> dependencies soon. > > Wether is is due to my previous email sent to this list or not - it's > another good sign. Thanks for the effort. > > Btw, I believe this list should be configured to replace the reply-to > in the header with Bea...@li.... > Otherwise one needs to replace the to-address manually when replying. > This message for example would have gone to de...@ne... if I > hadn't noticed... Thanks for the feedback, you're right. I'll fix that as soon as I find my admin password for the mailing list :) > Regards, > Marcel Robert. |
From: Marcel S. <ma...@fr...> - 2009-11-22 15:16:07
|
On 22.11.2009, at 12:43, Brautigam Róbert wrote: > Hi all, > > After a bit of time off, here is the new release of BeanKeeper, 2.6.1. A new release is always a good sign ;-) > [...] > > Also, a maven repository was finally created on sourceforge, and the > request was submitted to sync it to the central maven repository, so > BeanKeeper will be available for projects using maven through normal > dependencies soon. Wether is is due to my previous email sent to this list or not - it's another good sign. Thanks for the effort. Btw, I believe this list should be configured to replace the reply-to in the header with Bea...@li.... Otherwise one needs to replace the to-address manually when replying. This message for example would have gone to de...@ne... if I hadn't noticed... Regards, Marcel -- Marcel Stör, http://www.frightanic.com Couchsurfing: http://www.couchsurfing.com/people/marcelstoer Skype: marcelstoer |
From: Brautigam R. <de...@ne...> - 2009-11-22 12:07:50
|
Hi all, After a bit of time off, here is the new release of BeanKeeper, 2.6.1. This release focuses on refactoring. The obsolate internal architecture was replaced by a service-oriented architecture that is more flexible and extendable. The work is not fully completed, some features are still a bit tied in into places they don't belong, so this work will continue in next releases. Another major modification is migrating the full library from the old hu.netmind.persistence package to hu.netmind.beankeeper. This means of course, this release is not backwards compatible with older releases. It is however database compatible (it means it can work with 2.6.0-created databases). Also, a maven repository was finally created on sourceforge, and the request was submitted to sync it to the central maven repository, so BeanKeeper will be available for projects using maven through normal dependencies soon. The next release will focus on improving implementation quality. Improving test coverage, fixing bugs submitted by users and reported by findbugs, and also normalizing the package dependencies. Have fun! Robert. |
From: Marcel S. <ma...@fr...> - 2009-10-09 20:56:21
|
I noted with delight that with 2.6.0 BeanKeeper switched from Ant to Maven. In my opinion, however, you only covered half of the distance. AFAIK BeanKeeper is not available in any of the public Maven repositories such as ibiblio or http://repo2.maven.org/maven2/. Hence, in order for me to reference BeanKeeper from my own pom.xml I need to download BeanKeeper manually and install it manually in my local repository. Any plans to change that? Regards, Marcel -- Marcel Stör, http://www.frightanic.com Couchsurfing: http://www.couchsurfing.com/people/marcelstoer Skype: marcelstoer |
From: Brautigam R. <de...@ne...> - 2009-09-09 15:25:56
|
Daniel Fischer írta: > Hi, Hi Dan, > having reviewed quite a number of Java persistence solutions I think BeanKeeper > is by far the easiest and cleanest (but yet very powerful) solution. I was > especially taken with the full versioning concept which would be really helpful > in my application. Glad you like it. > But after reading the tutorial and the docs I'm still not sure: Are > persistent user transactions possible with BeanKeeper? I would like to make even > non-completed transactions to survive an application restart, s.t. users can > resume working with this transactions (after e.g. a server restart). First off, this is not possible. Transactions either complete entirely, or rollback everything, it has to be considered atomic to work. Although versioning might make it possible to retain some undefined state of a transaction (depending on where it ended), BeanKeeper still uses a database transaction, which is atomic in the above sense. This means if a transaction terminates before commit, all the updates will be lost. You may be looking for a persistent session store. Some web applications have these build it to guarantee that all the objects will be available after restart, or after transferring the load to a backup server or something. These work usually by just serializing the session object to some file periodically, so the work state is preserved. > Yours, > Daniel HTH, Robert. |
From: Daniel F. <da...@di...> - 2009-09-09 14:34:12
|
Hi, having reviewed quite a number of Java persistence solutions I think BeanKeeper is by far the easiest and cleanest (but yet very powerful) solution. I was especially taken with the full versioning concept which would be really helpful in my application. But after reading the tutorial and the docs I'm still not sure: Are persistent user transactions possible with BeanKeeper? I would like to make even non-completed transactions to survive an application restart, s.t. users can resume working with this transactions (after e.g. a server restart). This would require to make the non-completed transactions somehow persistent - but without sacrificing the transaction isolation of course (if user X has such a non-completed transaction open no other user should see the changes done inside it). Yours, Daniel |
From: Emily G. <emi...@go...> - 2009-06-11 11:20:24
|
Hi Robert, Thank you. Worked a charm :) Ta, Emily ----- Original Message ----- From: "Brautigam Róbert" <de...@ne...> To: "Emily Green" <emi...@go...> Cc: <bea...@li...> Sent: Thursday, June 11, 2009 12:10 PM Subject: Re: [Beankeeper-discussion] newbie using in memory hsql for unit tests and failing > Emily Green írta: >> Hi, > > Hi, > >> I'm new to Beankeeper. It's looks absolutely perfect for the thing I'm >> currently working on at the mo that's got enough database use to be too >> annoying to program directly, but not enough to make something a bit >> more bloated like Hibernate seem worthwhile (goodness I loathe those XML >> files!). >> >> Anyhow, I have a quick question - I'm probably doing some sort of newbie >> daft thing. When I write unit tests I normally use an in memory HSQL >> database, but I'm finding that when I do this through Beankeeper the >> database isn't shutdown and recreated properly between tests. I've >> written a hopefully simple example to show what I mean. What happens is >> that each of the two tests run fine on their own, but when ran together >> the results of the first test are left in the database causing the >> second test to fail as it finds two records rather than the expected one. > > The problem is, BeanKeeper does not issue a direct SHUTDOWN command to > hsqldb, so the database in theory still lives on after all the > connections to it are closed. You can try specifying the "shutdown=true" > parameter to your hsqldb url to force hsqldb to shutdown after the > connections are closed. > > Robert. > > |
From: Brautigam R. <de...@ne...> - 2009-06-11 11:11:22
|
Emily Green írta: > Hi, Hi, > I'm new to Beankeeper. It's looks absolutely perfect for the thing I'm > currently working on at the mo that's got enough database use to be too > annoying to program directly, but not enough to make something a bit > more bloated like Hibernate seem worthwhile (goodness I loathe those XML > files!). > > Anyhow, I have a quick question - I'm probably doing some sort of newbie > daft thing. When I write unit tests I normally use an in memory HSQL > database, but I'm finding that when I do this through Beankeeper the > database isn't shutdown and recreated properly between tests. I've > written a hopefully simple example to show what I mean. What happens is > that each of the two tests run fine on their own, but when ran together > the results of the first test are left in the database causing the > second test to fail as it finds two records rather than the expected one. The problem is, BeanKeeper does not issue a direct SHUTDOWN command to hsqldb, so the database in theory still lives on after all the connections to it are closed. You can try specifying the "shutdown=true" parameter to your hsqldb url to force hsqldb to shutdown after the connections are closed. Robert. |
From: Emily G. <emi...@go...> - 2009-06-11 11:03:07
|
Hi, I'm new to Beankeeper. It's looks absolutely perfect for the thing I'm currently working on at the mo that's got enough database use to be too annoying to program directly, but not enough to make something a bit more bloated like Hibernate seem worthwhile (goodness I loathe those XML files!). Anyhow, I have a quick question - I'm probably doing some sort of newbie daft thing. When I write unit tests I normally use an in memory HSQL database, but I'm finding that when I do this through Beankeeper the database isn't shutdown and recreated properly between tests. I've written a hopefully simple example to show what I mean. What happens is that each of the two tests run fine on their own, but when ran together the results of the first test are left in the database causing the second test to fail as it finds two records rather than the expected one. Hope I'm not being too annoying!! Thanks, Emily /** * Record object I'm going to be using in the test */ public class Record { private String value; public Record() { super(); } public void setValue(String value) { this.value = value; } public String getValue() { return value; } } /** * My failing unit test */ public class SimpleTest extends TestCase { private Store store; protected void setUp() throws Exception { store = new Store("org.hsqldb.jdbc.Driver", "jdbc:hsqldb:mem:test"); } protected void tearDown() throws Exception { store.close(); } public void testSavingARecord() { Record record = new Record(); record.setValue("bob"); store.save(record); List<Record> savedRecords = store.find("find record"); assertEquals(1, savedRecords.size()); Record firstSavedRecord = savedRecords.get(0); assertEquals("bob", firstSavedRecord.getValue()); } public void testSavingAnotherRecord() { Record record = new Record(); record.setValue("sue"); store.save(record); List<Record> savedRecords = store.find("find record"); assertEquals(1, savedRecords.size()); Record firstSavedRecord = savedRecords.get(0); assertEquals("sue", firstSavedRecord.getValue()); } } |
From: Brautigam R. <de...@ne...> - 2009-05-15 08:23:40
|
Jules írta: > I have a need to ensure that only one bean exists with a property set to > any specific value. If I were using SQL directly, I'd usually approach > this by adding a constraint to the table that the column was unique, but > there doesn't seem to be any way of making beankeeper do this. > > I've implemented it by locking the class, checking for existing values > with the attribute in question and then only creating if none exist, but > I'm not particularly happy with this. Is there a better way? I'm currently not aware of a more appropriate method to do this unfortunately. Robert. |