Eric B. | 1 Nov 2003 02:04
Picon
Favicon

Determining which Record a Field belongs to?

I've noticed that in the SFieldMeta class, there is a SRecordMeta variable
that specifies which specific class the field belongs to.  However, this
variable is a package protected variable only.  Is there a reason why this
design-choice was made?  I've run into a circumstance where from the field
name, I am looking to find out the name of the class that it belongs to.

Given that this information is already stored within SFieldMeta, I was
wondering if either adding a public method (ie: SRecordMeta
getRecordMeta(){ return sRecordMeta;}) in the SFieldMeta class or adding a
static method to the SUte class (ie: SRecordMeta getRecordMeta( SFieldMeta
sfm) {return sfm.sRecordMeta;} ) would be a good idea.  Is there a reason
why this information is hidden from outside the lib?

Either that, or is there another way to retrieve this information that I
haven't found?

Thanks!

Eric

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/5cFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
SimpleORM-unsubscribe <at> yahoogroups.com

(Continue reading)

Melissa & Anthony Berglas | 3 Nov 2003 04:11

Re: Determining which Record a Field belongs to?

Only that I have to support all public attributes.

Could you please go through the API and give me a list of things 
that should be made public?

Thanks,

Anthony

Eric B. wrote:

> I've noticed that in the SFieldMeta class, there is a SRecordMeta variable
> that specifies which specific class the field belongs to.  However, this
> variable is a package protected variable only.  Is there a reason why this
> design-choice was made?  I've run into a circumstance where from the field
> name, I am looking to find out the name of the class that it belongs to.
> 
> Given that this information is already stored within SFieldMeta, I was
> wondering if either adding a public method (ie: SRecordMeta
> getRecordMeta(){ return sRecordMeta;}) in the SFieldMeta class or adding a
> static method to the SUte class (ie: SRecordMeta getRecordMeta( SFieldMeta
> sfm) {return sfm.sRecordMeta;} ) would be a good idea.  Is there a reason
> why this information is hidden from outside the lib?
> 
> Either that, or is there another way to retrieve this information that I
> haven't found?
> 
> Thanks!
> 
> Eric
(Continue reading)

Melissa & Anthony Berglas | 3 Nov 2003 04:21

Re: SimpleORM Download Form

Extra documentation would be most welcome.  Perhaps as short
articles about specific topics.

Let us know how you go with your application.

Regards,

Anthony

f.fankhauser <at> tyro.at wrote:

> Email: f.fankhauser <at> tyro.at
> 
> Name: Florian Fankhauser
> 
> GoodPart: lightweight, fast, simple, innovative,...
> 
> Great work!
> 
> Concerns: The whitepaper is a good information, but i think, more documentation is needed. i.e. howto use
special datatypes like BLOBs. Hope, if my skills  grow, i can contribute something...
> 
> Organisation: TYRO Computer
> 
> City: Europe/Austria
> 
> OrgDesc: Software for Libraries
> 
> NrProgrammers: 3
> 
(Continue reading)

Melissa & Anthony Berglas | 3 Nov 2003 04:45

Re: Bug: SRecordMeta.flushAndPurge()

Oops.  It actually appears to work but I agree that it is nasty. 
Probably prefer approach #2 as more efficient.

Anthony

Weinhold Ingo wrote:

> Howdy,
> 
> I'm new to SimpleORM (more precisely have been evaluting it for a few weeks), so first thanks to Anthony for
the nice tool.
> 
> While reading a bit through the sources I've found a bug in SRecordMeta.flushAndPurge():
> 
>   public void flushAndPurge() {
>     SConnection scon = SConnection.getBegunConnection();    
>     java.util.Iterator ci = scon.transactionCache.values().iterator();
>     while (ci.hasNext()) {
>       SRecordInstance ri = (SRecordInstance)ci.next();
>       if (ri.getMeta() == this)
>         ri.flushAndPurge();
>     }
>   }
> 
> While iterating through transactionCache (a HashMap) ri.flushAndPurge() modifies it (remove()s the
entry), which is not considered safe (expect a ConcurrentModificationException earlier or later).
> 
> Simple solutions would be 1. to do the work in two passes -- build a separate list with the concerned records
first and iterate over it afterwards -- or 2. have a package private
SRecordInstance.flushAndPurge(boolean remove) that doesn't remove the record from the cache when
(Continue reading)

Melissa & Anthony Berglas | 3 Nov 2003 04:20

Re: Object Relational Mapping Tools

Hello Robert,

You are using IN in the SQL sense which is fine.  But EJBQL uses it
to navigate from parents to children which is a mess.

For JDO, any class that accesses a JDO class needs to be byte code
post processed.  Unless you wrap everything in get/set methods, in
which case why have the byte code post processing in the first place.

Some sort of interceptor mechanism would be good for Java.  In fact
I was talking to some Gemstone people who want to do that for their
own purpose.  But the Java language development seems to have died
at 1.1, with the exception of fixes forced by .Net.

Regards,

Anthony

Robert wrote:

> Dear Anthony,
> 
> I have some comments about the article at
> http://www.uq.net.au/~zzabergl/simpleorm/ORMTools.html
> 
> i) "IN()" operator
> 
> It's not fully clear to me why you ask "what does the IN() operator doing
> in a query language".  IMHO "e IN(x,y,z)" is just a shortcut for "(e == x
> || e == y || e == z)" which makes typing queries easier from time to time.
(Continue reading)

Pierre Awaragi | 7 Nov 2003 01:32
Picon
Favicon

Q: Transactions to multiple connections/datasources

Hi All,
 
I just started using SimpleORM library after an extensive search for the best O/R philosophy. Congrats to Anthony for this wonderfull tool.
 
I am trying to slowly incorporate simple orm into my already existing application and slowly convert my in-house OR classes. My application uses multiple datasources connected to multiple databases (all running on mysql 4.0.x server). I have a data source that connects to actual data entry records and another source to logs of these entries.
 
Insert into record
create log of record insertion.
 
My question is how can I insure that these two operations using two different database connections are encapsulated within the same transaction?  I cannot use two commits as if the first one success but the second, I cannot rollback the first after it's been already committed.
 
PS, the reason for splitting these information is that multiple servers can write to the same record database and each to its own log database. Access to the records is controlled by the logs so it's an all or nothing operation.
 
Thanks for all your help,
Pierre


To unsubscribe from this group, send an email to:
SimpleORM-unsubscribe <at> yahoogroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
McDaniel, Joe | 7 Nov 2003 15:28

RE: Q: Transactions to multiple connections/datasourc es

Pierre,
 
Aye! That's the rub! 
 
As best as I can figure, the only hope you have is to run each database instance in a separate thread or sequentially access the various databases. You can't create multiple connection objects with the current approach, unfortunately.
 
Best,
Joe
-----Original Message-----
From: Pierre Awaragi [mailto:pierrea <at> email.com]
Sent: Thursday, November 06, 2003 7:32 PM
To: SimpleORM <at> yahoogroups.com
Subject: [SimpleORM] Q: Transactions to multiple connections/datasources

Hi All,
 
I just started using SimpleORM library after an extensive search for the best O/R philosophy. Congrats to Anthony for this wonderfull tool.
 
I am trying to slowly incorporate simple orm into my already existing application and slowly convert my in-house OR classes. My application uses multiple datasources connected to multiple databases (all running on mysql 4.0.x server). I have a data source that connects to actual data entry records and another source to logs of these entries.
 
Insert into record
create log of record insertion.
 
My question is how can I insure that these two operations using two different database connections are encapsulated within the same transaction?  I cannot use two commits as if the first one success but the second, I cannot rollback the first after it's been already committed.
 
PS, the reason for splitting these information is that multiple servers can write to the same record database and each to its own log database. Access to the records is controlled by the logs so it's an all or nothing operation.
 
Thanks for all your help,
Pierre



To unsubscribe from this group, send an email to:
SimpleORM-unsubscribe <at> yahoogroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Lane Sharman | 7 Nov 2003 16:37

Re: Q: Transactions to multiple connections/datasources

You encapuslate both transactions in an outer transaction.

All participants vote.

If participant vote = 100% operationally successful, then the outer 
object authorizes each participant to do a commit.

-Lane

Pierre Awaragi wrote:

> Hi All,
>  
> I just started using SimpleORM library after an extensive search for 
> the best O/R philosophy. Congrats to Anthony for this wonderfull tool.
>  
> I am trying to slowly incorporate simple orm into my already existing 
> application and slowly convert my in-house OR classes. My application 
> uses multiple datasources connected to multiple databases (all running 
> on mysql 4.0.x server). I have a data source that connects to actual 
> data entry records and another source to logs of these entries.
>  
> Insert into record
> create log of record insertion.
>  
> My question is how can I insure that these two operations using two 
> different database connections are encapsulated within the same 
> transaction?  I cannot use two commits as if the first one success but 
> the second, I cannot rollback the first after it's been already committed.
>  
> PS, the reason for splitting these information is that multiple 
> servers can write to the same record database and each to its own log 
> database. Access to the records is controlled by the logs so it's an 
> all or nothing operation.
>  
> Thanks for all your help,
> Pierre
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
> click here 
>
<http://rd.yahoo.com/M=267637.4116730.5333196.1261774/D=egroupweb/S=1705006905:HM/A=1754451/R=0/SIG=11tm86fb5/*http://www.netflix.com/Default?mqso=60178323&partid=4116730> 
>
>
>
> To unsubscribe from this group, send an email to:
> SimpleORM-unsubscribe <at> yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
> <http://docs.yahoo.com/info/terms/>.

--

-- 
Lane Sharman
Just Do IT, Better.
858-755-2868

sylvainhamel | 7 Nov 2003 16:28
Picon
Favicon

Re: Q: Transactions to multiple connections/datasources

Hi,

Someone said that you cant use multiple database connection. Havent 
done a lot of simultaneous connection recently but you could just 
detach the connection without closing it then reattach it when you 
want to continue working on your transaction. 

Heres how to do transaction that span more than one database.
At the end of each database processing you flush your SQL statements 
to the database. If both pass correctly then you commit on both 
database transaction to officialize the transaction. I think you can 
have SimpleORM do all this automatically but have never tried it.

Sylvain

--- In SimpleORM <at> yahoogroups.com, "Pierre Awaragi" <pierrea <at> e...> 
wrote:
> Hi All,
>  
> I just started using SimpleORM library after an extensive search 
for the
> best O/R philosophy. Congrats to Anthony for this wonderfull tool.
>  
> I am trying to slowly incorporate simple orm into my already 
existing
> application and slowly convert my in-house OR classes. My 
application
> uses multiple datasources connected to multiple databases (all 
running
> on mysql 4.0.x server). I have a data source that connects to actual
> data entry records and another source to logs of these entries.
>  
> Insert into record
> create log of record insertion.
>  
> My question is how can I insure that these two operations using two
> different database connections are encapsulated within the same
> transaction?  I cannot use two commits as if the first one success 
but
> the second, I cannot rollback the first after it's been already
> committed.
>  
> PS, the reason for splitting these information is that multiple 
servers
> can write to the same record database and each to its own log 
database.
> Access to the records is controlled by the logs so it's an all or
> nothing operation.
>  
> Thanks for all your help,
> Pierre

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/5cFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
SimpleORM-unsubscribe <at> yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Pierre Awaragi | 7 Nov 2003 18:17
Picon
Favicon

FW: Q: Transactions to multiple connections/datasources

Hi,

Thanks already for the fast responses. Given my inexperience with
SimpleORM, is it possible to get some sample code or at least some
instructions as to which functions/classes one must referre to?

This also brings the question to: if you have flushed a transaction/sql
statement successfully, does that mean that when it is committed,
success is guaranteed? If not, then flushing two statements and then
commiting is the same as the original delemma.

Thanks in advance for all your help

Pierre

--------------------------

Hi,

Someone said that you cant use multiple database connection. Havent 
done a lot of simultaneous connection recently but you could just 
detach the connection without closing it then reattach it when you 
want to continue working on your transaction. 

Heres how to do transaction that span more than one database.
At the end of each database processing you flush your SQL statements 
to the database. If both pass correctly then you commit on both 
database transaction to officialize the transaction. I think you can 
have SimpleORM do all this automatically but have never tried it.

Sylvain

-----------------------
You encapuslate both transactions in an outer transaction.

All participants vote.

If participant vote = 100% operationally successful, then the outer
object authorizes each participant to do a commit.

-Lane

Pierre Awaragi wrote:

Hi All,

I just started using SimpleORM library after an extensive search for the
best O/R philosophy. Congrats to Anthony for this wonderfull tool.

I am trying to slowly incorporate simple orm into my already existing
application and slowly convert my in-house OR classes. My application
uses multiple datasources connected to multiple databases (all running
on mysql 4.0.x server). I have a data source that connects to actual
data entry records and another source to logs of these entries.

Insert into record
create log of record insertion.

My question is how can I insure that these two operations using two
different database connections are encapsulated within the same
transaction?  I cannot use two commits as if the first one success but
the second, I cannot rollback the first after it's been already
committed.

PS, the reason for splitting these information is that multiple servers
can write to the same record database and each to its own log database.
Access to the records is controlled by the logs so it's an all or
nothing operation.

Thanks for all your help,
Pierre

To unsubscribe from this group, send an email to:
SimpleORM-unsubscribe <at> yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 

--

-- 
Lane Sharman
Just Do IT, Better.
858-755-2868

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/5cFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
SimpleORM-unsubscribe <at> yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


Gmane