beankeeper-discussion Mailing List for BeanKeeper (Page 3)
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: Brautigam R. <de...@ne...> - 2009-03-03 07:59:32
|
Shay Matasaro írta: > i only create the public schema in the DB, not any tables . > > yes, i believe there is some difference in how the console app and web > app behave , because they both use the same library which includes the > persistence classes. > > here is the table map, and classes table : > > tablemap: > "bk_domain";"domain" > "bk_vreseller";"vreseller" > "bk_vreseller_domains_";"vreseller_domains_" > "bk_vreseller_vrusers_";"vreseller_vrusers_" > "bk_vuser";"vuser" > "java_lang_object";"object" > "persistence_classes";"classes" > "persistence_nodes";"nodes" > "";"" > > > classes: > "";1;"java_lang_object";"java.lang.Object";0 > "";2;"bk_domain";"BK.Domain";1000 > "";3;"bk_vreseller";"BK.VReseller";1000 > "";4;"bk_vuser";"BK.VUser";1000 > "";;"";""; Looks alright to me. We're back to why is the webapp throwing ClassNotFoundException for BK.* classes. It still looks like BeanKeeper does not see them. Please make sure the classes are in the webapp. On another note, there may be a classloading issue. For example if the BeanKeeper library is not in your webapp, but added to your application server, then the classloader hierarchy will prevent BeanKeeper from seeing your classes. What application server do you use, and where is the BeanKeeper jar and the classes that it should use? Robert. |
From: Shay M. <mat...@gm...> - 2009-03-03 07:46:10
|
i only create the public schema in the DB, not any tables . yes, i believe there is some difference in how the console app and web app behave , because they both use the same library which includes the persistence classes. here is the table map, and classes table : tablemap: "bk_domain";"domain" "bk_vreseller";"vreseller" "bk_vreseller_domains_";"vreseller_domains_" "bk_vreseller_vrusers_";"vreseller_vrusers_" "bk_vuser";"vuser" "java_lang_object";"object" "persistence_classes";"classes" "persistence_nodes";"nodes" "";"" classes: "";1;"java_lang_object";"java.lang.Object";0 "";2;"bk_domain";"BK.Domain";1000 "";3;"bk_vreseller";"BK.VReseller";1000 "";4;"bk_vuser";"BK.VUser";1000 "";;"";""; Shay Brautigam Róbert wrote: > Shay Matasaro írta: > >> Hi, >> >> i keep getting the warnings seen below , even when performing the >> following steps: >> 1) drop the pubic schema >> 2) recreate the public schema >> 3) run my console app to create a few test objects and save them >> 4) launch the web app that perform a simple one table query >> >> when these warning are showing even that simple query(last line) does >> not work >> > > Those messages indicate that the webapp you're starting does not see the > classes: BK.Domain, BK.VReseller, BK.VUser. > How do you create the schema? You don't need to do that, that will be > done automatically. > When you run the console app to create a few objects, you use some > classes to do that. The messages indicate that those classes are not > available under the webapp. Is that true? > > >> there could be no traces in the DB because i dropped the schema, and no >> changes are made to the DB classes, during this test. >> > > Ok, then it's probably a difference between the command line tool and > the webapp. They must be using different classes. > > >> also when i check the "tablemap" table i can see that the table exists >> and the name is spelled correctly >> > > Could you paste in the tablemap and classes table? > > > Robert. > > |
From: Brautigam R. <de...@ne...> - 2009-03-03 07:38:51
|
Shay Matasaro írta: > Hi, > > i keep getting the warnings seen below , even when performing the > following steps: > 1) drop the pubic schema > 2) recreate the public schema > 3) run my console app to create a few test objects and save them > 4) launch the web app that perform a simple one table query > > when these warning are showing even that simple query(last line) does > not work Those messages indicate that the webapp you're starting does not see the classes: BK.Domain, BK.VReseller, BK.VUser. How do you create the schema? You don't need to do that, that will be done automatically. When you run the console app to create a few objects, you use some classes to do that. The messages indicate that those classes are not available under the webapp. Is that true? > there could be no traces in the DB because i dropped the schema, and no > changes are made to the DB classes, during this test. Ok, then it's probably a difference between the command line tool and the webapp. They must be using different classes. > also when i check the "tablemap" table i can see that the table exists > and the name is spelled correctly Could you paste in the tablemap and classes table? Robert. |
From: Brautigam R. <de...@ne...> - 2009-03-03 07:33:58
|
Shay Matasaro írta: > Hi, > > Is there a way to identify the transition stage in which a server node > has gone down, and the clients are busy choosing a new server node, in > order to retry the query? > > Actually, it would be even better if the store itself would wait and > retry the query instead of throwing an exception. Retry is not easy, we haven't figured it out yet. The problem is, when you build up a transaction with a server, and the server goes down, you can't just commit on another server, the whole context of the transaction has to be present (locks, events, etc), so you have to build the transaction up again from the start. Currently, the exception that is thrown is not specific, so you can't tell whether it was because the server went down or not. There is a DisconnectEvent sent however when the client disconnects. Robert. |
From: Shay M. <mat...@gm...> - 2009-03-03 04:18:14
|
Hi, i keep getting the warnings seen below , even when performing the following steps: 1) drop the pubic schema 2) recreate the public schema 3) run my console app to create a few test objects and save them 4) launch the web app that perform a simple one table query when these warning are showing even that simple query(last line) does not work there could be no traces in the DB because i dropped the schema, and no changes are made to the DB classes, during this test. also when i check the "tablemap" table i can see that the table exists and the name is spelled correctly [httpSSLWorkerThread-8080-0] INFO hu.netmind.persistence.DatabaseFactory - got data source to: PostgreSQL (8.3.6) through driver: PostgreSQL Native Driver (PostgreSQL 8.3 JDBC4 with SSL (build 604)) [httpSSLWorkerThread-8080-0] WARN hu.netmind.persistence.ClassTracker - could not find class (BK.Domain) to table: bk_domain. This may only mean that a class was removed, but there are traces in the database for it, in this case, you may disregard this message: BK.Domain (java.lang.ClassNotFoundException) [httpSSLWorkerThread-8080-0] WARN hu.netmind.persistence.ClassTracker - could not find class (BK.VReseller) to table: bk_vreseller. This may only mean that a class was removed, but there are traces in the database for it, in this case, you may disregard this message: BK.VReseller (java.lang.ClassNotFoundException) [httpSSLWorkerThread-8080-0] WARN hu.netmind.persistence.ClassTracker - could not find class (BK.VUser) to table: bk_vuser. This may only mean that a class was removed, but there are traces in the database for it, in this case, you may disregard this message: BK.VUser (java.lang.ClassNotFoundException) [httpSSLWorkerThread-8080-0] WARN hu.netmind.persistence.ClassTracker - could not find class (BK.Domain) to table: bk_domain. This may only mean that a class was removed, but there are traces in the database for it, in this case, you may disregard this message: BK.Domain (java.lang.ClassNotFoundException) [httpSSLWorkerThread-8080-0] WARN hu.netmind.persistence.ClassTracker - could not find class (BK.VReseller) to table: bk_vreseller. This may only mean that a class was removed, but there are traces in the database for it, in this case, you may disregard this message: BK.VReseller (java.lang.ClassNotFoundException) [httpSSLWorkerThread-8080-0] WARN hu.netmind.persistence.ClassTracker - could not find class (BK.VUser) to table: bk_vuser. This may only mean that a class was removed, but there are traces in the database for it, in this case, you may disregard this message: BK.VUser (java.lang.ClassNotFoundException) [httpSSLWorkerThread-8080-0] INFO hu.netmind.persistence.Store - returning empty result list because of non-fatal symbol error. Parser said: could not find class for table name: Domain, statement was: find Domain where name=? Shay |
From: Shay M. <mat...@gm...> - 2009-03-03 00:18:57
|
Hi, Is there a way to identify the transition stage in which a server node has gone down, and the clients are busy choosing a new server node, in order to retry the query? Actually, it would be even better if the store itself would wait and retry the query instead of throwing an exception. Thanks, Shay Brautigam Róbert wrote: > Shay Matasaro írta: > >> Hi Róbert, >> >> firstly , I'd like to thank you for your help . >> > > No problem, I learn as much as you do. > > ... > >> i have setup the store as a singleton. >> >> but I am running 2 application at any given moment , one is a web app >> under glassfish , and the other is a standalone console app that i use >> for testing, debugging , etc... >> >> are they interfering with each other? >> >> although i am running both from within Nebeans , i assumed they were >> using different JVMs >> > > Even if they are in different JVMs, two BeanKeeper nodes accessing the > same database will connect to eachother and exchange synchronization and > other data that is necessary to ensure atomicity, etc of operations. So > yes, they are interfering. > This is not a problem though, it should work unless the appointed server > node (which is usually what started first) is stopped, in which case the > client nodes have no other option than to indicate the error and > reorganize around a new server node. > > >> the console app completes its tasks and the shuts down , while the web >> app is stopped when i deploy a new version , i also often breakpoint >> both apps in debugging mode. >> >> is this the wrong way to do things? >> >> which approach do you recommend? >> > > It should be ok, as long as both are running. If one is shut down, the > other might throw a few errors indicating that the server node just went > down. After that is should come back as a server. > > >> Thanks, >> Shay >> >> >> Brautigam Róbert wrote: >> >>> Shay Matasaro írta: >>> >>> >>>> Hi, >>>> >>>> i am getting the following exception when attempting to add an object >>>> to a List. >>>> >>>> hu.netmind.persistence.DatabaseFactory - got data source to: >>>> PostgreSQL (8.3.6) through driver: PostgreSQL Native Driver >>>> (PostgreSQL 8.3 JDBC3 with SSL (build 603)) >>>> Exception in thread "main" hu.netmind.persistence.StoreException: >>>> client thread is shutting down, so no response will be available. >>>> 2009-03-02 02:50:18,177 [Persistence-client] ERROR >>>> hu.netmind.persistence.node.NodeClient - error while listening for >>>> server events. >>>> >>>> >>> Hello, >>> >>> This is only possible, if you had multiple BeanKeeper Stores running at >>> the same time. This happens when the server node shuts down, in which >>> case the clients will abort all running transactions. >>> Be sure you have only one node running, or don't close the other nodes >>> during the operation. >>> >>> Robert. >>> >>> >>> >> > > > |
From: Brautigam R. <de...@ne...> - 2009-03-02 20:02:43
|
Shay Matasaro írta: > Hi, Hi, > the following is taken form form the Save Jdoc, i belive that the > description should be expended,please see my questions inline : You're right, the APIdoc does not explain the save logic enough. It is also outdated a bit. > Save the given object to the store. The given object's all private > non-transient fields will be saved. If the object was not selected from > the store, and not yet saved, it will be created in the store, and a > unique id will be assigned, so all subsequent calls to save the given > object will only modify the already existing instance in store. A few tips: > 1) only private fields ? what about public and protected? Currently all nontransient nonstatic fields are saved. The apidoc is wrong, whether the field is private does not matter. > 2) the existence or no existence of accessors methods does not affect > the library at all? No it does not. It works kind of like java serialization. The internal state of the object is what matters, so that will be saved, no matter the methods. > * Use simple beans. Although this library does not scan methods to > determine the attributes to save, it is a good idea to simplify > work with them. > > 3) what do you mean by simple? for example i am using the > XMLRootElement annotation, and i implement numerous interfaces , should > i avoid it? It means it is advised to use Java beans. Simple means it should only have private fields and getters, maybe setters. This has nothing to do with beankeeper, it's just sane measures for a good data model. > 4) if the library does not use reflection how does it get the list of > fields? It does use reflection to get the fields. It does get the methods, it gets the fields directly. > * If you do not use simple beans, watch out that your object does > not reference unnecessary objects, because if it does, all will be > saved/inserted and tracked. > > 5) i assume that marking such objects as transient will address that? Yes. > * You CAN use objects which reference other beans though. But > beware, that all objects which are directly referenced will be > loaded when the parent object loads. > > 6) can you expend on the above? Direct reference means there is a field which is an object. Indirect reference means an object hold another in a Map or Collection. All directly referenced objects are loaded when the parent object is loaded, so the more objects are referenced directly the longer it takes to load the object. This is a known problem among O/R libraries. There is no known good way to solve this currently. > * You CAN use Map, and List types in your beans. Check the > documentation. > > some samples on what not do and best practices, would probably be helpful. Yes, you're right. As a rule of thumb, what seems easy will be easy to do, what looks complex will be harded to select/save. For example beans with only primitive fields are the easiest. Beans with other beans referenced are harder. Maps and Collections are harder still. The more complex the data model, the harder to select, etc. > hopefully anybody that reads my posts , will get a some hints ,on what > not to do :) Generally you should have a clean data model, that is not deep (level of direct references), and direct references should be typed if that's possible (not Object, but something more concrete). > Thanks, > Shay I know these are only general tips, you're right that we should write up a more detailed list of good and bad practices. Robert. |
From: Brautigam R. <de...@ne...> - 2009-03-02 16:08:29
|
Shay Matasaro írta: > Hi Róbert, > > firstly , I'd like to thank you for your help . No problem, I learn as much as you do. ... > i have setup the store as a singleton. > > but I am running 2 application at any given moment , one is a web app > under glassfish , and the other is a standalone console app that i use > for testing, debugging , etc... > > are they interfering with each other? > > although i am running both from within Nebeans , i assumed they were > using different JVMs Even if they are in different JVMs, two BeanKeeper nodes accessing the same database will connect to eachother and exchange synchronization and other data that is necessary to ensure atomicity, etc of operations. So yes, they are interfering. This is not a problem though, it should work unless the appointed server node (which is usually what started first) is stopped, in which case the client nodes have no other option than to indicate the error and reorganize around a new server node. > the console app completes its tasks and the shuts down , while the web > app is stopped when i deploy a new version , i also often breakpoint > both apps in debugging mode. > > is this the wrong way to do things? > > which approach do you recommend? It should be ok, as long as both are running. If one is shut down, the other might throw a few errors indicating that the server node just went down. After that is should come back as a server. > Thanks, > Shay > > > Brautigam Róbert wrote: >> Shay Matasaro írta: >> >>> Hi, >>> >>> i am getting the following exception when attempting to add an object >>> to a List. >>> >>> hu.netmind.persistence.DatabaseFactory - got data source to: >>> PostgreSQL (8.3.6) through driver: PostgreSQL Native Driver >>> (PostgreSQL 8.3 JDBC3 with SSL (build 603)) >>> Exception in thread "main" hu.netmind.persistence.StoreException: >>> client thread is shutting down, so no response will be available. >>> 2009-03-02 02:50:18,177 [Persistence-client] ERROR >>> hu.netmind.persistence.node.NodeClient - error while listening for >>> server events. >>> >> >> Hello, >> >> This is only possible, if you had multiple BeanKeeper Stores running at >> the same time. This happens when the server node shuts down, in which >> case the clients will abort all running transactions. >> Be sure you have only one node running, or don't close the other nodes >> during the operation. >> >> Robert. >> >> > > |
From: Shay M. <mat...@gm...> - 2009-03-02 14:41:36
|
Hi, the following is taken form form the Save Jdoc, i belive that the description should be expended,please see my questions inline : Save the given object to the store. The given object's all private non-transient fields will be saved. If the object was not selected from the store, and not yet saved, it will be created in the store, and a unique id will be assigned, so all subsequent calls to save the given object will only modify the already existing instance in store. A few tips: 1) only private fields ? what about public and protected? 2) the existence or no existence of accessors methods does not affect the library at all? * Use simple beans. Although this library does not scan methods to determine the attributes to save, it is a good idea to simplify work with them. 3) what do you mean by simple? for example i am using the XMLRootElement annotation, and i implement numerous interfaces , should i avoid it? 4) if the library does not use reflection how does it get the list of fields? * If you do not use simple beans, watch out that your object does not reference unnecessary objects, because if it does, all will be saved/inserted and tracked. 5) i assume that marking such objects as transient will address that? * You CAN use objects which reference other beans though. But beware, that all objects which are directly referenced will be loaded when the parent object loads. 6) can you expend on the above? * You CAN use Map, and List types in your beans. Check the documentation. some samples on what not do and best practices, would probably be helpful. hopefully anybody that reads my posts , will get a some hints ,on what not to do :) Thanks, Shay |
From: Shay M. <mat...@gm...> - 2009-03-02 14:00:19
|
Hi Róbert, firstly , I'd like to thank you for your help . as you can see from my posts , i am trying to use Beankeepr in a commercial environment which is why all these issues are popping up , and why your prompt responses are much appreciated , as i am working around the clock on this app. i have setup the store as a singleton. but I am running 2 application at any given moment , one is a web app under glassfish , and the other is a standalone console app that i use for testing, debugging , etc... are they interfering with each other? although i am running both from within Nebeans , i assumed they were using different JVMs the console app completes its tasks and the shuts down , while the web app is stopped when i deploy a new version , i also often breakpoint both apps in debugging mode. is this the wrong way to do things? which approach do you recommend? Thanks, Shay Brautigam Róbert wrote: > Shay Matasaro írta: > >> Hi, >> >> i am getting the following exception when attempting to add an object to >> a List. >> >> hu.netmind.persistence.DatabaseFactory - got data source to: PostgreSQL >> (8.3.6) through driver: PostgreSQL Native Driver (PostgreSQL 8.3 JDBC3 >> with SSL (build 603)) >> Exception in thread "main" hu.netmind.persistence.StoreException: client >> thread is shutting down, so no response will be available. >> 2009-03-02 02:50:18,177 [Persistence-client] ERROR >> hu.netmind.persistence.node.NodeClient - error while listening for >> server events. >> > > Hello, > > This is only possible, if you had multiple BeanKeeper Stores running at > the same time. This happens when the server node shuts down, in which > case the clients will abort all running transactions. > Be sure you have only one node running, or don't close the other nodes > during the operation. > > Robert. > > |
From: Brautigam R. <de...@ne...> - 2009-03-02 10:13:12
|
Shay Matasaro írta: > Hi, > > i am getting the following exception when attempting to add an object to > a List. > > hu.netmind.persistence.DatabaseFactory - got data source to: PostgreSQL > (8.3.6) through driver: PostgreSQL Native Driver (PostgreSQL 8.3 JDBC3 > with SSL (build 603)) > Exception in thread "main" hu.netmind.persistence.StoreException: client > thread is shutting down, so no response will be available. > 2009-03-02 02:50:18,177 [Persistence-client] ERROR > hu.netmind.persistence.node.NodeClient - error while listening for > server events. Hello, This is only possible, if you had multiple BeanKeeper Stores running at the same time. This happens when the server node shuts down, in which case the clients will abort all running transactions. Be sure you have only one node running, or don't close the other nodes during the operation. Robert. |
From: Shay M. <mat...@gm...> - 2009-03-02 07:57:36
|
Hi, i am getting the following exception when attempting to add an object to a List. hu.netmind.persistence.DatabaseFactory - got data source to: PostgreSQL (8.3.6) through driver: PostgreSQL Native Driver (PostgreSQL 8.3 JDBC3 with SSL (build 603)) Exception in thread "main" hu.netmind.persistence.StoreException: client thread is shutting down, so no response will be available. 2009-03-02 02:50:18,177 [Persistence-client] ERROR hu.netmind.persistence.node.NodeClient - error while listening for server events. at hu.netmind.persistence.node.NodeClient.sendObject(NodeClient.java:111) java.io.EOFException at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2554) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1297) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at hu.netmind.persistence.node.NodeClient$MessageListener.run(NodeClient.java:281) at java.lang.Thread.run(Thread.java:619) at hu.netmind.persistence.node.NodeClient.nextId(NodeClient.java:414) at hu.netmind.persistence.node.NodeManager.nextId(NodeManager.java:688) at hu.netmind.persistence.ObjectTracker.registerObject(ObjectTracker.java:217) at hu.netmind.persistence.ListImpl$ObjectWrapper.<init>(ListImpl.java:1050) at hu.netmind.persistence.ListImpl.add(ListImpl.java:558) at java.util.AbstractList.add(AbstractList.java:91) at BK.VRes.addDomain(VRes.java:35) at consoleapp.Main.main(Main.java:53) here is the class: public class VRes implements Serializable { protected String name; protected List vrUsers ; protected List domains; public void addDomain(Domain domain) { if (domains==null) { domains = new Vector(); } domains.add(domain); } Thanks, Shay |
From: Brautigam R. <de...@ne...> - 2009-03-01 18:32:07
|
Shay Matasaro írta: > does a table structure only get updated , when an object of that type is > written to the DB? > > i.e. until first insert schema wont get updated? Each class gets updated when it's used the first time by any of the Store methods, or any of it's super- or sub-classes are used. In short all tables are updated when BeanKeeper needs to use it. "Static" classes are updated once each run, while dynamic classes are always updated if their attributes change runtime. > Thanks, > Shay Robert. |
From: Brautigam R. <de...@ne...> - 2009-03-01 18:28:58
|
Shay Matasaro írta: > Hi, > > how does BeanKeepr handle schema changes(or to be exact class structure > changes)? > what happens when a field is removed? > > what happens when a filed is added? > > are the table dropped in those cases? Currently BeanKeeper has a wired-in schema evolution algorithm to handle some simple cases. It does basically this: - class added: table is created - 1 field added: table is not dropped, field is added with default value for existing objects (usually null or 0) - 1 field is removed: table is not dropped, only if there are no other fields - 1 field renamed or type changed: handled as 1 removed, 1 added For more complex changes (like added a subclass, or class hierachy changed otherwise) a migration is probably necessary. Currently there is not automation or helper scripts for this unfortunately. > i am seeing the following messages in my log file : > > "could not find class (data.VReseller) to table: data_vreseller. This > may only mean that a class was removed, but there are traces in the > database for it, in this case, you may disregard this message: > data.VReseller (java.lang.ClassNotFoundException)" > what is the cause for these? On startup BeanKeeper consults the database for classes that were used on that database anytime in the past. It tries to see if those classes are ok or not. This message indicates, that at one point in time there were data.VReseller objects stored, but that class is currently not available to the system, so that table will not be used. This is Ok if you really removed that class. > i also see this error in the logs : > "returning empty result list because of non-fatal symbol error. Parser > said: could not find class for table name: vreseller, statement was: > find vreseller where VReseller.domain=?" > > altghou i can see the table vreseller in the DB? This means that no known class matching VReseller is being used in the database. If the previous ClassNotFoundException is for the same class, this would mean, either the class data.VReseller is really not available to BeanKeeper, or you renamed it, perhaps moved it to another package. > Thanks, > Shay Robert. |
From: Shay M. <mat...@gm...> - 2009-03-01 15:30:41
|
does a table structure only get updated , when an object of that type is written to the DB? i.e. until first insert schema wont get updated? Thanks, Shay |
From: Shay M. <mat...@gm...> - 2009-03-01 15:27:55
|
Hi, how does BeanKeepr handle schema changes(or to be exact class structure changes)? what happens when a field is removed? what happens when a filed is added? are the table dropped in those cases? i am seeing the following messages in my log file : "could not find class (data.VReseller) to table: data_vreseller. This may only mean that a class was removed, but there are traces in the database for it, in this case, you may disregard this message: data.VReseller (java.lang.ClassNotFoundException)" what is the cause for these? i also see this error in the logs : "returning empty result list because of non-fatal symbol error. Parser said: could not find class for table name: vreseller, statement was: find vreseller where VReseller.domain=?" altghou i can see the table vreseller in the DB? Thanks, Shay |
From: Shay M. <mat...@gm...> - 2009-02-26 07:34:57
|
Thanks! Brautigam Róbert wrote: > Shay Matasaro írta: > >> Hi , >> > > Hi, > > >> my sample app has a company data object and a user data object, i would >> like usernames to be unique, across the board. >> >> i assume that maintaining this uniqueness per company is done via the >> collection container of the company ( Set<user> company users) >> >> how do i make sure that usernames are unique across companies(the >> parallel of unique property on a DB column), do i have to run a GetName >> query before each user addition? >> > > In short, yes. The longer answer is, that BeanKeeper is Java-side only, > so you can't get part of your logic implemented in the database, like > unique names, field constraints, hard relations, etc. You must do > everything at the Java side. > Of course BeanKeeper will use optimizations on the database, but the > general direction is, that you should not need to, and if fact should > not be able to do database (low) level stuff. > > Be aware also, that a persistent Set in BeanKeeper is unique always on > persistence id (so persistent instance of object), and not using the > equals() and hashCode() you implement. So Sets (and Lists also) store > relations, instead of objects in this sense. > > >> thanks, >> Shay >> > > Robert. > > |
From: Brautigam R. <de...@ne...> - 2009-02-26 06:51:22
|
Shay Matasaro írta: > Hi , Hi, > my sample app has a company data object and a user data object, i would > like usernames to be unique, across the board. > > i assume that maintaining this uniqueness per company is done via the > collection container of the company ( Set<user> company users) > > how do i make sure that usernames are unique across companies(the > parallel of unique property on a DB column), do i have to run a GetName > query before each user addition? In short, yes. The longer answer is, that BeanKeeper is Java-side only, so you can't get part of your logic implemented in the database, like unique names, field constraints, hard relations, etc. You must do everything at the Java side. Of course BeanKeeper will use optimizations on the database, but the general direction is, that you should not need to, and if fact should not be able to do database (low) level stuff. Be aware also, that a persistent Set in BeanKeeper is unique always on persistence id (so persistent instance of object), and not using the equals() and hashCode() you implement. So Sets (and Lists also) store relations, instead of objects in this sense. > thanks, > Shay Robert. |
From: Shay M. <mat...@gm...> - 2009-02-26 00:33:11
|
Hi , my sample app has a company data object and a user data object, i would like usernames to be unique, across the board. i assume that maintaining this uniqueness per company is done via the collection container of the company ( Set<user> company users) how do i make sure that usernames are unique across companies(the parallel of unique property on a DB column), do i have to run a GetName query before each user addition? thanks, Shay |
From: Brautigam R. <de...@ne...> - 2009-02-25 09:43:16
|
Shay Matasaro írta: > Questions: > 1) section 4.3 of the documentation , confused me a bit , does the > library support containers other then map, list , set , collection > (|Vector| and |ArrayList| are mentioned)? Almost all containers are supported. Map, Set, List and Collection are the super-interfaces of all containers in Java, so they all are implicitly supported. Map - keys and values, no duplicate keys Set - no duplicate items, but on ordering List - duplicate items possible, ordering preserved Collection is implemented as Set currently. What you do is, you declare your containers either Map, Set, List depending on what you want. You can initialize them with any container type that implements these interfaces. > 2) is there an advantage to using the DB connection pooling that is > supplied by glassfish in combination with Beankeeper, since the library > has its own connection pooling? This isn't correctly documented. BeanKeeper does use connection pooling when constructed with driverclass and url. It does NOT use pooling when constructed with a DataSource, because most of the time DataSources are pooling. So if you use a DataSource to construct Store, you should set it up to pool. > Thanks, > Shay Robert. |
From: Shay M. <mat...@gm...> - 2009-02-25 08:30:51
|
Comments: 1) installation and build were easy , although i know very little about Maven. 2) i am using Glassfish and web services , so i had to install all runtime Jars in the Glassfish lib directory. 3) needed to revise postgres driver name from "postgres" to "postgressql". 4) once this settings were done , first app that i wrote worked like a charm! :) 5) The documentation is helpful and to the point. Questions: 1) section 4.3 of the documentation , confused me a bit , does the library support containers other then map, list , set , collection (|Vector| and |ArrayList| are mentioned)? 2) is there an advantage to using the DB connection pooling that is supplied by glassfish in combination with Beankeeper, since the library has its own connection pooling? Thanks, Shay |
From: Brautigam R. <de...@ne...> - 2009-02-24 19:52:25
|
Shay Matasaro írta: > Hi All, Hi, ... > I came in with good intentions , but instead found myself for the last > 45 days messing about with Spring, JPA, Hibernate, Toplink, EclipseLink, > and Glassfish settings > > *side note - these are just the persistence realted technologies, don't > even get me started about JAAS , EJB , , etc... :) I know what you mean. I've been a professional Java developer/architect for 9 years now, and I still really know only a fraction of the stuff that's out there. > i ran into Beankeeper while looking for alternatives. and i really like > the approach , i will start coding today. > > we are a startup company developing a commercial product which will > allow us to test beankeeper with real-wold requirements. > > since i am coming from .NET world , i am a pretty "lazy" and "spoiled" > developer and used to focus only on biz concepts and not the low level > stuff that seems to be plaguing Java world ( people seem to be doing > more XML programming then actual Java coding), which makes me an ideal > user from the Beankeeper philosophy perspective. > > Ill start coding ASAP and send my comments and questions to the list. Okay, welcome to the list, and thank you for giving it a try. > I appluade your initiative. > Shay Robert. |
From: Shay M. <mat...@gm...> - 2009-02-24 18:41:00
|
Hi All, i have recently switched from .Net world to Java ,because i believe that Open source has become viable enough to compare with commercial software. I came in with good intentions , but instead found myself for the last 45 days messing about with Spring, JPA, Hibernate, Toplink, EclipseLink, and Glassfish settings *side note - these are just the persistence realted technologies, don't even get me started about JAAS , EJB , , etc... :) i ran into Beankeeper while looking for alternatives. and i really like the approach , i will start coding today. we are a startup company developing a commercial product which will allow us to test beankeeper with real-wold requirements. since i am coming from .NET world , i am a pretty "lazy" and "spoiled" developer and used to focus only on biz concepts and not the low level stuff that seems to be plaguing Java world ( people seem to be doing more XML programming then actual Java coding), which makes me an ideal user from the Beankeeper philosophy perspective. Ill start coding ASAP and send my comments and questions to the list. I appluade your initiative. Shay |
From: Brautigam R. <de...@ne...> - 2009-02-10 12:41:36
|
Hello all, The focus of the next release will be code cleanup. The selected features will be: - Rewrite service handling - Improve emma coverage - Rewrite node handling code - Provide maven artifacts Details can be found at the feature tracker in sourceforge. Comments welcome, Robert. |
From: Brautigam R. <de...@ne...> - 2009-02-09 23:36:09
|
Frank Weber írta: > Hallo Robert, > >> So BeanKeeper does not have any bindings yet out-of-the-box, but you >> don't have to use unmanaged transaction either. You just create a >> binding for the specific container you are trying to use, like Spring. >> There were already projects, where BeanKeeper was used with AOP only >> (with a @Tx annotation on methods) for example. > > So far I have not ventured to much into the AOP space. The tutorial > states related to JBoss AOP: "With minimal configuration you can > easily mark a method to be handled in a single transaction, ..." > To my understanding this refers to starting the transaction before and > committing the transaction after a business method like for example > createPerson(..). But I still need to explicitly invoke store(person) > in createPerson(..), or? Yes, you have to call Store.save(person) or Store.remove(person) explicitly to tell BeanKeeper what to do. This is unlike other persistence frameworks which "track" your objects runtime. BeanKeeper only does something if it's told to do something. If you want to somehow abstract BeanKeeper out of your code, you can write a good interface and use that instead of Store with a factory pattern for example. > Thanks in advance, > Frank Robert. |