Spring Transactions

2006-03-09 Thread Saman Ghodsian
Hi there,

 

I have an implementation of my model with OJB using just PersistenceBroker.
Now I'm looking into adding transactional support, looked into ODMG but it
seems complex to implement since all my mapping and query is in Broker
lingo, so I'm looking at injecting Transaction support for my process
methods with spring, that way I shouldn't need to change config files and
just one class that interfaces with the Broker. Now, I tried to look for
samples outthere found this 

 

http://www.springframework.org/node/116

 

But after setting it up transactions don't seem to be happening. So my
questions are.

1-   Do I need to use InnoDB on Mysql ? My tables are MyIsam.

2-   Am I missing any other feature besides applicationContext setup and
deriving my class from PersistenceBrokerDaoSupport?

 

Here is the applicationContext.xml

 

beans

  !-- Transaction manager for a single OJB PersistenceBroker (alternative
to JTA) --

  bean id=transactionManager
class=org.springframework.orm.ojb.PersistenceBrokerTransactionManager/

 

  bean id=genericProcess class=com.met.process.Generic/

 

  bean id=payrollManager

 
class=org.springframework.transaction.interceptor.TransactionProxyFactoryBe
an

property name=transactionManager

  ref local=transactionManager/

/property

property name=target

  ref local=genericProcess/

/property

property name=transactionAttributes

  props

prop key=complete*PROPAGATION_REQUIRED/prop

prop key=terminate*PROPAGATION_REQUIRED/prop

prop key=*PROPAGATION_REQUIRED,readOnly/prop

  /props

/property

  /bean

/beans

 

Thanks

 

Sam



DListImpl

2004-01-25 Thread Saman Ghodsian
Hi everyone,
I've been using PB to implement my persistence framework, works wonders so
far
Now I came accross a point that needs to use a list in a class similar to
DListImpl, where I can have a collection of objects without having to set a
forignkey on the N side
Is there a way of using DListImpl from PB? And if not Is there a way of
initializing the DListImpl without having to do
OJB.getInstance().newDListImpl()??
That way I can keep my convention of not using Persistence related code in
my model.

Thanks,
Saman




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ojb-tags

2004-01-20 Thread Saman Ghodsian
Hi there,
Has anyone used ojb-tags? and if so... in tomcat 5?
I've been having problems using it getting exceptions
Is it still being mantained?

Thanks

Saman


Re: ojb-tags

2004-01-20 Thread Saman Ghodsian
Thanks for the response Thomas.
Keep up the great work you guys are doing.
OJB rocks!!




Mahler Thomas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi Saman,

 The ojb-tags are part of the contributions package. This archive contains
 contributions that are not part of the maintained distribution.
 The Ojb Tags library was developed by Jacob Hookom (Jacob.Hookom at
 redline.mckhboc.com) for 1.0.RC3.

 I think it makes sense to talk directly to Jacob.

 cheers,
 Thomas

  -Original Message-
  From: Saman Ghodsian [mailto:[EMAIL PROTECTED]
  Sent: Monday, January 19, 2004 11:31 AM
  To: [EMAIL PROTECTED]
  Subject: ojb-tags
 
 
  Hi there,
  Has anyone used ojb-tags? and if so... in tomcat 5?
  I've been having problems using it getting exceptions
  Is it still being mantained?
 
  Thanks
 
  Saman
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ojb-tags

2004-01-19 Thread Saman Ghodsian
Hi there,
Has anyone used ojb-tags? and if so... in tomcat 5?
I've been having problems using it getting exceptions
Is it still being mantained?

Thanks

Saman




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



M:n relation

2003-07-10 Thread Saman Ghodsian
Hi everyone, here is my problem with m:n non-decomposed associations
I have to classes Actor and Role,
the problem is that when I try to persist the m:n relation the
indirection-table doesn't get populated
I've looked in the Logs and something interesting was happening.
After inserting an actor or Role, OJB is issuing a DELETE !!!

here is my code and mapping info
Help appreciated


Comments: 
String ObjectLookup is an extention from ManageableCollection



[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: executeInsert
: [EMAIL PROTECTED]
[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: executeInsert:
[EMAIL PROTECTED]: INSERT INTO
organization_role (oid,name,description,unit_id) VALUES
(581,'Anyone',null,[EMAIL PROTECTED]
[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG:
executeUpdateSQL: DELETE FROM organization_actorRole WHERE mRole_id=?
[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: executeInsert
: [EMAIL PROTECTED]
[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: executeInsert:
[EMAIL PROTECTED]: INSERT INTO
organization_actor (oid,name,password,mIsActive,actorManager_id) VALUES
(582,'saman',null,'0',[EMAIL PROTECTED]
[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG:
executeUpdateSQL: DELETE FROM organization_actorRole WHERE mActor_id=?



-

class-descriptor
class=com.met.boma.organization.Actor
table=organization_actor

collection-descriptor
name=mRoles
element-class-ref=com.met.boma.organization.Role
indirection-table=organization_actorRole
collection-class=com.met.boma.generic.StringObjectLookup

fk-pointing-to-this-class column=mActor_id/
fk-pointing-to-element-class column=mRole_id/
/collection-descriptor



class-descriptor
class=com.met.boma.organization.Role
table=organization_role

  collection-descriptor
name=mActors
element-class-ref=com.met.boma.organization.Actor
indirection-table=organization_actorRole
collection-class=com.met.boma.generic.StringObjectLookup

fk-pointing-to-this-class column=mRole_id/
fk-pointing-to-element-class column=mActor_id/
/collection-descriptor



-
   Actor actor = new Actor();   
   actor.setName(Actor);
   
   Role role = new Role();
   role.setName(Anyone);
   
   role.putActor(actor);   
   actor.putRole(role);   
   
   broker.store(actor);   
   broker.store(role);


Saman Ghodsian
CTO
Middle Earth Technologies Ltd.
www.metca.com
Cell (604)-839-7791
Vancouver, BC
Canada



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Sorted list

2003-06-26 Thread Saman Ghodsian
Hi everyone,

I've been trying to find a way to have a sorted list where I can do a
get method on the key, right now I'm using to lists, one that I have
implemented based on the java SortedMap list and a vector, then when OJB
uses the setList method I go and add all the elements to the sorted map,
and viceversa Problem is of course performance I've been looking
in implementing my Sorted List by implementing the ManageableCollection
Interface, the question Is if that's all I would need to do? Just
implement those methods and have my repository collection tag to my own
?
Anyone has come across this before? Any hints appreciated

Thanks,



Saman Ghodsian
CTO
Middle Earth Technologies Ltd.
www.metca.com
Cell (604)-839-7791
Vancouver, BC
Canada



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Sorted list

2003-06-26 Thread Saman Ghodsian


Saman Ghodsian
CTO
Middle Earth Technologies Ltd.
www.metca.com
Cell (604)-839-7791
Vancouver, BC
Canada



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, June 26, 2003 12:34 PM
 To: OJB Users List
 Subject: Re: Sorted list
 
 
 Hi,
 
 Saman Ghodsian wrote:
  Hi everyone,
  
  I've been trying to find a way to have a sorted list where 
 I can do a 
  get method on the key, right now I'm using to lists, one 
 that I have 
  implemented based on the java SortedMap list and a vector, 
 then when 
  OJB uses the setList method I go and add all the elements to the 
  sorted map, and viceversa Problem is of course performance 
  I've been looking in implementing my Sorted List by 
 implementing the 
  ManageableCollection Interface, the question Is if that's 
 all I would 
  need to do? Just implement those methods and have my repository 
  collection tag to my own ?
 
 yes, that should be sufficient. have a look at 
 org.apache.ojb.broker.util.collections.ManageableHashSet for 
 an example. It is a HashSet that implements the 
 ManageableCollection interface.
Ok I'll try that way

 Are you willing to share your Map class? I'd love to add more user 
 defined ManageableCollections to the util.collections package.
For sure, I'll let you know when I'm done and tested the solution

 cheers,
 Thomas
 
  Anyone has come across this before? Any hints appreciated
  
  Thanks,
  
  
  
  Saman Ghodsian
  CTO
  Middle Earth Technologies Ltd.
  www.metca.com
  Cell (604)-839-7791
  Vancouver, BC
  Canada
  
  
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: LongObjectLookup

2003-06-20 Thread Saman Ghodsian
Hi Thomas,
Exactly, What I need is to have a collection of objects sorted by Long,
String or Date keys...

Thanks for your reply

Saman Ghodsian
CTO
Middle Earth Technologies Ltd.
www.metca.com
Cell (604)-839-7791
Vancouver, BC
Canada



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 19, 2003 2:26 PM
To: OJB Users List
Subject: Re: LongObjectLookup


Hi Saman,

Saman Ghodsian wrote:
 Hi everyone
 I need anyones suggestion on this one...
 I'm trying to implement a List indexed by a Long value or a String 
 value attached to an object

I don't know exactly what you want to do.
Do you want to implement a Map that maps Long or String values to other 
persistent entity objects?

Or something else?

please give us some more details,
cheers,
Thomas

 Does anyone know which is the best way to go about it?
 Code samples or hints appreciated
 
 
 
 
 
 
 Saman Ghodsian
 CTO
 Middle Earth Technologies Ltd.
 www.metca.com
 Cell (604)-839-7791
 Vancouver, BC
 Canada
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem retrieving class

2003-06-10 Thread Saman Ghodsian
Hi there,

It's late and I've been trying to do this for a while so I'll just post
this message hoping I get a reply in the morning


I have a class structure, everything works fine when I store the objects
in DB, but after doing a select and trying to cast the object to my type
I get a classCastException

i.e 

Account acc = (Account) result.get(0);


Any ideas? Thanks 

Sam


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]